Skip to content

Faster again. Now uses less memory than StatsBase version.

Compare
Choose a tag to compare
@PGS62 PGS62 released this 21 Jan 15:43
· 426 commits to main since this release
  1. Rewrote insertionsort! and mergesort! by copy-paste-edit from the relevant methods of sort! in base/sort.jl. Upshot was further speed improvements and reduction in memory footprint. The function now allocates 30% to 40% less memory than the StatsBase version.

    In the case of insertionsort! it might be possible to use sort! instead, but with a custom !isless(x,y) and that would avoid the unpleasant code duplication. But in the case of mergesort! I don't think that is possible as the function !isless would not "know" by how much to increase the swaps counter.

    Note that StatsBase.corkendall can also be criticised for for code duplication. It contains the mergesort algorithm in disguise as the function swaps!.

  2. Moved function corkendallnaive to the tests folder.