A Benchmark for Phobos Sort Algorithm

spir denis.spir at gmail.com
Thu Dec 16 00:01:09 PST 2010


On Wed, 15 Dec 2010 23:07:46 -0800
Jonathan M Davis <jmdavisProg at gmx.com> wrote:

> It would be nice to get a fairly extensive lists of types to sort with a variety 
> of values and number of values of those types and set up an extensive set of 
> benchmarking tests. Heck, such a set of types and collections of those types 
> could be a useful benchmarking tool for a variety of algorithms. Then we'll have 
> a good base to build from and compare to. If we're going to tweak algorithms for 
> efficiency, we're going to want to some thorough tests so that we're sure that any 
> tweaks are actually overall improvements. It's easy to find cases which do poorly 
> for a particular algorithm. It can even be fairly easy to tweak an algorithm to 
> improve that particular case. But it's not so easy to be sure that that tweak is 

On one hand, having sut a source data set would be nice nice. On the other, such general-purpose algorithm simply cannot perform well; so, I would not bother much.
If one does need efficiency, then it is necessary to use or write a custom sort adapted to the data type (int), the value space ([1,99]), the actual distribution (many small values), the degree of pre-ordering of source data (bigger values have higher chances to come last),...
The performance ratio between a specific and general algorithm can be huge, as you know.

Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com



More information about the Digitalmars-d mailing list