qsort vs 'Magnetica' Quicksort
by Sanmayce from LinuxQuestions.org on (#5RQ74)
Just wrote my qsort() replacement, wanna share it with the community and stress my variant with more versatile data...
Generally, we have three major scenarios:
few distinct keys;
many distinct keys;
ALL distinct keys.
In first two cases, the new implementation is faster or equal to the "Standard" one.
Sadly, in the third case, it is somewhat slower, should be investigated further.
Anyway, benchmarking will show the practical value of 'Magnetica', personally, I started to use it already.
Please, give it a try, my new partitioning scheme is not perfect but pushes the limitations of old ones.
Didn't have time to add the second scenario, but the results (for 1st scenario, with 10 distinct keys) are promising:
273.8/3.7= 74x faster
Attached Files
Generally, we have three major scenarios:
few distinct keys;
many distinct keys;
ALL distinct keys.
In first two cases, the new implementation is faster or equal to the "Standard" one.
Sadly, in the third case, it is somewhat slower, should be investigated further.
Anyway, benchmarking will show the practical value of 'Magnetica', personally, I started to use it already.
Please, give it a try, my new partitioning scheme is not perfect but pushes the limitations of old ones.
Didn't have time to add the second scenario, but the results (for 1st scenario, with 10 distinct keys) are promising:
273.8/3.7= 74x faster
Attached Files
QS_bench.c.txt (18.5 KB) |