[Issue 16517] topN performance very poor on certain data sets

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Sep 23 09:05:48 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16517

Andrei Alexandrescu <andrei at erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei at erdani.com

--- Comment #1 from Andrei Alexandrescu <andrei at erdani.com> ---
I don't have a ldc testing rig installed, but with
https://github.com/dlang/phobos/pull/4815 and dmd I get the following for your
code and data:

$ dmd -O -inline -release -ofmedian_by_topn -boundscheck=off -version=topn
issue16517.d 
$ dmd -O -inline -release -ofmedian_by_sort -boundscheck=off issue16517.d  
$ cut -f 2  /tmp/googlebooks-eng-all-1gram-20120701-0 | ./median_by_sort
median (via sort): 1972; lines: 10512769; total time (ms): 2246; sort time
(ms): 412
$ cut -f 2  /tmp/googlebooks-eng-all-1gram-20120701-0 | ./median_by_topn
median (via topN): 1972; lines: 10512769; total time (ms): 1823; topN time
(ms): 35

Although results obtained using dmd are not comparable, the trend is
encouraging. If you could patch your stdlib with the pull request it would be
great. Thanks!

--


More information about the Digitalmars-d-bugs mailing list