News for hackers. Stuff that matters.
Re:Go performance from version 1.2 to 1.18 by zmmmmm on Friday February 04, 2022 @12:41AM (#30203295)
Seems to be mainly a test of compiling regexes, rather than executing them. Which is a bit pointless because few applications would not pre-compile regexes ... and then it would actually be penalising languages that put more effort into optimisation and hence perform better in the real world at execution.
Re:Go performance from version 1.2 to 1.18 by burntsushi on Friday February 04, 2022 @09:39AM (#30207273)
Why would you even say this? It is certainly not a test of compiling regexes. Go and profile any one of those programs. You'll see that the majority of time is spent executing the search, not the compilation.

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

Re:Go performance from version 1.2 to 1.18 by zmmmmm on Friday February 04, 2022 @08:29PM (#30216084)
Apologies, you're correct. I mistook the use of Pattern.compile chained with replaceAll to mean that it was compiling the regex every time it used it.