JuliaLang/julia — pull request #7069 by dcjones (2014-06-01 22:46:51+00:00)
Title: Improvements to regex performance.

Prompted by #7066, I've rearranged some things in regex.

The main change to avoid allocating `ovec` ("offset vector") for each match and just allocate in once, since it's fixed size. `PCRE.exec` also just returns true/false now which I think helps with type inference.

Results are pretty good! Here's @swadey's benchmark:

Before:
```
elapsed time: 98.95128192 seconds (3390129384 bytes allocated)
```

After:
```
elapsed time: 5.496844491 seconds (1374146072 bytes allocated)
```

Python's still a little bit faster here:
```
elapsed time: 4.05045199394
```