Comment #0 by jrdemail2000-dlang — 2021-03-15T02:34:23Z
I have observed a regex related performance regression my tsv-utils package when switching from LDC 1.24.0 to LDC 1.25.0. This corresponds to a performance regression in DMD 2.095.
Mostly likely cause is Phobos PR #7678: https://github.com/dlang/phobos/pull/7678.
A possible cause was identified by Petar Kirov in the issue comments (https://github.com/dlang/phobos/pull/7678#issuecomment-787814712):
> At first glance, the suspect could be the two new delegates
> defaultFactoryImpl and matchOnceImpl. They may or may not
> cause GC allocations. If they are replaced with static nested
> functions, they would be guaranteed not to cause GC allocations.
Checking GC stats using "--DRT-gcopt=profile:1" indicates increased GC in the program:
With DMD 2.094.2:
> Number of collections: 0
> Total GC prep time: 0 milliseconds
> Total mark time: 0 milliseconds
> Total sweep time: 0 milliseconds
> Max Pause Time: 0 milliseconds
> Grand total GC time: 0 milliseconds
> GC summary: 5 MB, 0 GC 0 ms, Pauses 0 ms < 0 ms
With DMD 2.095.1
> Number of collections: 672
> Total GC prep time: 7 milliseconds
> Total mark time: 62 milliseconds
> Total sweep time: 7 milliseconds
> Max Pause Time: 1 milliseconds
> Grand total GC time: 76 milliseconds
> GC summary: 5 MB, 672 GC 76 ms, Pauses 69 ms < 1 ms
The regular expression used in the tests is '[RD].*ION[0-2]', run against 14 million lines (one invocation per line). It's one of my standard benchmarks.
I am investigating further.
Comment #1 by jrdemail2000-dlang — 2021-03-21T09:24:10Z