Morwenn / cpp-sort

Sorting algorithms & related tools for C++14
MIT License
621 stars 57 forks source link

Improve the state of mergesorts #175

Open Morwenn opened 3 years ago

Morwenn commented 3 years ago

The library contains a bunch of mergesort variants, and at least three of them will adapt depending on how much memory is provided. However they follow different strategies:

I don't know what should be done, but bringing some uniformity to the table could be good. Also, more urgent: the stable sort benchmarks need to be redone since they are currently unfair by virtue of benchmarking several mergesort variants with varying amounts of heap memory available. There should be at least two different benchmarks: one with O(n) memory available and one with O(1). Being thorough with regard to all the allocations in-between is more complicated and can be considered later.

Having a versatile interface for memory buffers would be nice. Currently there's also no allocator support, which might be something desirable.