Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Would you know of a good set of regexps to benchmark?
- I'm sure there are many I don't know about out there. It's just a fun thing to work on! I haven't looked, but I suspect that node.js must use the Google v8 regexp engine, in which case it would be bactracking and would not perform dominating regexp extraction, so rather slow on complex regexps.
- I just benchmarked git-grep on the same regexps, and it performs super well. It takes generally slightly more time on 'sys' and 'user' results, but the 'real' times are generally better (multi-threading behaves superbly).
- regexp engine sys user real
- foobar git-grep 0.51 0.56 0.23
- foobar taskset 1 git-grep 0.32 0.48 0.81
- foobar jrep 0.23 0.08 0.32
- foobar grep-2.17 0.18 0.51 0.70
- However it looks like it does not perform dominating regexps extraction, so the performance on complex regexps is only excellent (with a risk of getting worse).
- regexp engine sys user real
- ^\s*(void|unsigned|int)\s+func\s+\( git-grep 0.31 5.67 0.85
- ^\s*(void|unsigned|int)\s+func\s+\( taskset 1 git-grep 0.28 4.10 4.38
- ^\s*(void|unsigned|int)\s+func\s+\( jrep 0.25 0.12 0.35
- ^\s*(void|unsigned|int)\s+func\s+\( grep-2.17 0.18 1.15 1.33
- So out of the box it is really good. That tells me I should be looking more at the multi-threading!
Advertisement
Add Comment
Please, Sign In to add comment