Can golang beat perl on regex performance?
crypticjags.com
crypticjags.com
On related topic, in this case utf8 is not needed so switching to []byte oriented api is good idea (and as an added benefit - slices are cheaper to copy then strings) - see comparison https://gist.github.com/tumdum/83581aee2693a60f5133
It's not surprising that the Perl is faster, as it is all in C, and has had lots of optimizations over a few decades. I've had similar results between perl and things like grep, Ruby, python etc. Perl comes out on top!