[Issue 17820] std.regex performance: .matchFirst allocates frequently; causes thread contention
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Sat Sep 9 22:19:52 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=17820
--- Comment #1 from Chad Joan <chadjoan at gmail.com> ---
The benchmark output seems like it might wrap poorly in bugzilla's page, so
here is an edited version that should fit better:
Windows 7 machine with dmd v2.076.0:
--------------------------------------------------------
C:\dprojects\regex\benchmark>dmd main.d -release -O -m64
C:\dprojects\regex\benchmark>main
non-regex parsing, parallel: 100000 elements in 0.061s.
regex parsing, no captures, parallel: 100000 elements in 202.893 s.
regex parsing, many captures, parallel: 100000 elements in 977.339 s.
non-regex parsing, serial: 100000 elements in 0.031 s.
regex parsing, no captures, serial: 100000 elements in 202.395 s.
regex parsing, many captures, serial: 100000 elements in 837.401 s.
--------------------------------------------------------
Slightly slower (hardware-wise) Linux (Gentoo) machine with dmd v2.074.1:
--------------------------------------------------------
$ dmd main.d -release -O -m64
$ ./main
non-regex parsing, parallel: 100000 elements in 0.062 s.
regex parsing, no captures, parallel: 100000 elements in 88.055 s.
regex parsing, many captures, parallel: 100000 elements in 93.546 s.
non-regex parsing, serial: 100000 elements in 0.043 s.
regex parsing, no captures, serial: 100000 elements in 135.063 s.
regex parsing, many captures, serial: 100000 elements in 135.250 s.
--------------------------------------------------------
--
More information about the Digitalmars-d-bugs
mailing list