Hacker News new | ask | show | jobs
by Terribledactyl 3307 days 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.

2 comments

> 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...

I 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.