You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golan...@googlegroups.com
Dear list!
I recently looked at the "regex-dna" [1] benchmark at Computer Language Benchmarks Game and apparently Go runs 28x slower (145.22s / 5.22s) than C++ despite both using re2.
Please, can someone help me understand the reason for such a difference?
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golan...@googlegroups.com
On Wednesday, February 11, 2015 at 2:02:14 PM UTC+1, Tuom Larsen wrote:
I recently looked at the "regex-dna" [1] benchmark at Computer Language Benchmarks Game and apparently Go runs 28x slower (145.22s / 5.22s) than C++ despite both using re2.
Please, can someone help me understand the reason for such a difference?
Go only uses re2's syntax, not the library. Go's regexp package only does minor optimizations on expressions and builds a finite automaton at runtime.
Speculation: C++ probably uses metaprogramming (templates) to build the automatons at compile time, taknig full advantage of a compiler's optimization capabilities.
Ian Lance Taylor
unread,
Feb 11, 2015, 10:08:22 AM2/11/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Tuom Larsen, golang-nuts
On Wed, Feb 11, 2015 at 5:02 AM, Tuom Larsen <tuom....@gmail.com> wrote:
>
> I recently looked at the "regex-dna" [1] benchmark at Computer Language
> Benchmarks Game and apparently Go runs 28x slower (145.22s / 5.22s) than C++
> despite both using re2.
>
> Please, can someone help me understand the reason for such a difference?
They both use re2 but they use entirely different implementations of
it. The C++ re2 includes several optimizations that the Go version
does not.