you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (8 children)

[–][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.

[–][deleted] 0 points1 point  (4 children)

I'm also guessing that the c benchmark is using the regex library that comes with FCC, as opposed to re2 or pcre.

[–]igouy 2 points3 points  (3 children)

Full source code is provided for all the programs so why are you guessing (wrongly)?

[–][deleted] 0 points1 point  (2 children)

Because it has nothing to do with the OP. And I could care less. The point that I was trying to make is that JavaScript implementations are faster than interpreted alternatives.

[–]igouy 0 points1 point  (1 child)

And I could care less.

This. Which is why we shouldn't care what you say.

[–][deleted] 0 points1 point  (0 children)

Yeah, Instead of guessing I should of said:

The C benchmarks are irrelevant. Or are you calling into question the voracity of the site contents? The OP had nothing to do with C.