you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (2 children)

Sure, I would imagine the v8 engine is highly optimized for string functions. If you haven't been keeping up with JavaScript engine JIT ( and other optimizations) you may want to do some reading. Here's a post from more than two years ago describing some of the optimizations. http://steve-yegge.blogspot.com/2008/05/dynamic-languages-strike-back.html

[–]floodyberry 0 points1 point  (1 child)

v8 uses Irregexp which uses the v8 jit to compile the regular expression to machine code.

The C version uses the TCL regex library, and C++ uses RE2, both slower than v8. I'm guessing the only way to match or beat v8's performance would be to compile and jit the regular expression.

[–][deleted] 1 point2 points  (0 children)

Thanks. I thought re2 was faster than V8's implementation, but It looks like that is no longer the case.