3 ms·
>regex-redux (edge case?) 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 fe
by Terribledactyl 9y ago
>regex-redux (edge case?)
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.
- weberc2 9y agoI think Go's regex lib is native Go, but simply naive. In any case, this particular benchmark isn't useful unless your application is regex as a service.
- igouy 9y ago> 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?test=regexredux&lang=go&id=1 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?test=regexredux&lang=go&id=9 http://benchmarksgame.alioth.debian.org/u64q/program.php?tes...