Re:Benchmark: Java, Python, PHP, C, JavaScript, Swift, Ruby,...
by igouy on Sunday June 04, 2017 @01:46PM
(#14482566)
> I don't know exactly why … and without profiling it I'd guess a huge hit is that alone.
Don't guess. Look at the measurements. Look at the source code. That Go PCRE program is faster than --
http://benchmarksgame.alioth.debian.org/u64q/program.php?tes...
Maybe faster still to use some of the techniques from this other Go PCRE program --
http://benchmarksgame.alioth.debian.org/u64q/program.php?tes...
It looks like the JS version is using the built in runtime's regex engine.
I don't know exactly why (maybe differences or missing features in go's regex) but the go version is actually using the c FFI to call pcre.h, and without profiling it I'd guess a huge hit is that alone.