Hacker News new | ask | show | jobs
by unfasten 5694 days ago
I was browsing the language shootout the other day and came across the page for the regex test. I'm not sure how it's doing it or if something is wrong with the test but V8 is outperforming everything else, including C. That's the only test it leads though.

Here are the results: http://shootout.alioth.debian.org/u32/performance.php?test=r...

Also worth noting that TraceMonkey isn't too far behind. Does anyone know why the JS engines, especially V8, are performing so well on this test?

P.S. Here's how V8/TraceMonkey stack up for all the tests: http://shootout.alioth.debian.org/u32/which-programming-lang...

3 comments

V8 JIT-compiles regular expressions. I don't know what C/C++ do -- I'd assume they run the state machine directly, but maybe they do compile it further like V8 does.

http://blog.chromium.org/2009/02/irregexp-google-chromes-new...

Look at the source code of the C program. It uses glib and the TCL libraries and it even includes locking for the multicore benchmark.
Look at the source code of the other C regex-dna programs which don't use glib or Tcl libraries.