The top times for the mentioned languages are:
Rust: 0.78s
Ruby: 12.33s
Java: 5.34s
Go: 3.80s
Python: 1.34s
Python #2 1.34s PCRE2
Go #5 3.80s PCRE
Java #3 5.34s
Java #6 5.39s
Java #1 8.49s
Python #1 9.25s "standard library"
Go #4 15.60s PCRE
Go #3 26.86s "standard library"
Go #1 27.01s "standard library"https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
regex=PCRE2.pcre2_compile_8(pattern, c_size_t(len(pattern)), c_uint32(0),
byref(c_int()), byref(c_size_t()), None)
As far as FFI goes, I would say this looks amazingly simple.https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
C gcc #6 0.56s
Java #3 0.79sLook at the runtimes being mentioned here. We're talking on the order of seconds. The benchmark itself calls for 15 pretty simple regexes to be compiled. Regex compilation of 1ms or longer would be considered slow I think. So that's 15ms. That's nearly nothing compared to the full runtime of the benchmark. Even if you assumed each regex took 10ms on average to compile, you're still only looking at 150ms total.
I say this as the author of Rust's regex engine and as someone who has spent a non-trivial time looking at and thinking about this particular benchmark.