phobos/changelog/std-algorithm-searching-extremum.dd
Sebastian Wilzbach 169c82c938 std.algorithm.searching: no mapping-specialization for extremum (#5001)
std.algorithm.searching: no mapping-specialization for extremum
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
2017-03-03 05:00:49 +01:00

22 lines
790 B
Text

Performance improvements for `std.algorithm.searching.{min,max}Element`
$(REF minElement, std, algorithm, searching) and $(REF maxElement, std, algorithm, searching)
are now considerably faster (almost 2x in microbenchmarks)
as a special path for the identity case is provided. This allows the compiler
to make use of SSE instructions.
The exact improvements are:
$(CONSOLE
% dmd -release -O test.d && ./test
extremum.before = 54 secs, 12 ms, 347 μs, and 9 hnsecs
extremum.after = 29 secs, 521 ms, 896 μs, and 5 hnsecs
)
$(CONSOLE
% ldc -release -O3 test.d && ./test
extremum.before = 13 secs, 186 ms, 176 μs, and 4 hnsecs
extremum.after = 2 secs, 241 ms, 454 μs, and 9 hnsecs
)
$(LINK2 https://gist.github.com/wilzbach/9f757fa76200956aadb97059d614df34, See the benchmark code).