Guest User

Untitled

a guest
Mar 6th, 2014
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. Would you know of a good set of regexps to benchmark?
  2.  
  3. 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.
  4.  
  5.  
  6. 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).
  7.  
  8. regexp engine sys user real
  9. foobar git-grep 0.51 0.56 0.23
  10. foobar taskset 1 git-grep 0.32 0.48 0.81
  11. foobar jrep 0.23 0.08 0.32
  12. foobar grep-2.17 0.18 0.51 0.70
  13.  
  14. 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).
  15.  
  16. regexp engine sys user real
  17. ^\s*(void|unsigned|int)\s+func\s+\( git-grep 0.31 5.67 0.85
  18. ^\s*(void|unsigned|int)\s+func\s+\( taskset 1 git-grep 0.28 4.10 4.38
  19. ^\s*(void|unsigned|int)\s+func\s+\( jrep 0.25 0.12 0.35
  20. ^\s*(void|unsigned|int)\s+func\s+\( grep-2.17 0.18 1.15 1.33
  21.  
  22. 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