mirror of
https://github.com/dlang/phobos.git
synced 2025-05-02 16:10:45 +03:00
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>
This commit is contained in:
parent
5356dc2353
commit
169c82c938
2 changed files with 188 additions and 21 deletions
22
changelog/std-algorithm-searching-extremum.dd
Normal file
22
changelog/std-algorithm-searching-extremum.dd
Normal file
|
@ -0,0 +1,22 @@
|
|||
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).
|
Loading…
Add table
Add a link
Reference in a new issue