# Regex performance on Windows 10

**URL:** https://discourse.julialang.org/t/regex-performance-on-windows-10/32113
**Category:** General Usage
**Tags:** question, performance
**Created:** [December 10, 2019, 6:53pm UTC](https://discourse.julialang.org/t/regex-performance-on-windows-10/32113 "2019-12-10T18:53:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Dictino](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dictino/32/217281_2.png) [@Dictino](https://discourse.julialang.org/u/Dictino)
#### Post date: [December 10, 2019, 6:53pm UTC](https://discourse.julialang.org/t/regex-performance-on-windows-10/32113/1 "2019-12-10T18:53:52Z")

</div>

Hi

This is my first post here so sorry if this is not a good place for this question.  
I’ve observed that there is an important performance difference between Windows 10 and Linux in regex match performance MWE:

```julia
module test

text=repeat("hellu",100_000_000)
text=text*"hello"*text

print("findfirst: ")
@time n=findfirst("hello",text) #just to compare with

print("match: ")
@time m=match(r"hello",text) #the real thing I'm trying go measure

text=""
GC.gc()

end

```

When I execute this code in my work computer with **Windows10** I obtain the following:

```julia
findfirst: 1.354450 seconds (9 allocations: 416 bytes)
match: 0.962716 seconds (10 allocations: 496 bytes)

```

But the same code inside a Virtual machine with linux guest in the **same computer** gives:

```julia
findfirst: 4.171840 seconds (8 allocations: 368 bytes)
match: 0.319563 seconds (10 allocations: 496 bytes)

```

findfirst is 3 times slower in the VM (not surprise here), but match is **3 times _faster_**

And using a real linux box (on a 10 year old machine that I use at home) I get:

```julia
findfirst: 1.141698 seconds (9 allocations: 416 bytes)
match: 0.111905 seconds (10 allocations: 496 bytes)

```

That is 8.6 times faster. In fact the old linux box at home is faster in findfirts also… (Definitely I must not retire this machine 😉 )

What can be the reason? Is it an issue of the PCRE library on windows?

Here are the versions versions of everithing just in case is usefull.

work computer with W10

```julia
Julia Version 1.3.0
Commit 46ce4d7933 (2019-11-26 06:09 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, haswell)

```

Linux virtual machine (in the same work computer)

```julia
Julia Version 1.3.0
Commit 46ce4d7933 (2019-11-26 06:09 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, haswell)

```

Linux box (at home)

```julia
Julia Version 1.3.0
Commit 46ce4d7933 (2019-11-26 06:09 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM)2 Quad CPU Q8200 @ 2.33GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, penryn)

```
