Hi all,recently have been working on a new version of the plf::colony container (plflib.org) and found GCC9 was giving 10-12% worse performance on a given benchmark than GCC8.
Previous versions of the colony container did not experience this performance loss going from GCC8 to GCC9. However Clang 6 and MSVC2019 show no performance loss going from the old colony version to the new version.
The effect is repeatable across architectures - I've tested on xubuntu, windows running nuwen mingw, and on Core2 and Haswell CPUs, with and without -march=native specified.
Compiler flags are: -O2;-march=native;-std=c++17Code is attached with an absolute minimum use-case - other benchmarks have not shown such strong performance differences - including both simpler and more complex tests.
So I cannot reduce further, please do not ask me to do so.The benchmark in question inserts into a container initially then iterates over container elements repeatedly, randomly erasing and/or inserting new elements.
In addition I've attached the assembly output under both GCC8 and GCC9. In this case I have output from 8.2 and 9.2 respectively, but the same effects apply to 8.4 and 9.3. The output for 8 is a lot larger than 9, wondering if there's more unrolling occurring.
Any questions let me know. I will help where I can, but my knowledge of assembly is limited. If supplying the older version of colony is useful I'm happy to do so.
Nanotimer is a ~nanosecond-precision sub-timeslice cross-platform timer. Colony is a bucket-array-like unordered sequence container. Thanks, Matt
<<attachment: benchmark_code_and_results.zip>>