klmr92 / uguu

Automatically exported from code.google.com/p/uguu
Other
0 stars 1 forks source link

[smbscan] replace qsort by merge sort in dt.c #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is not a hard task but there is other work now.
And of course the new code should be benchmarked against current one using
some really large share

Original issue reported on code.google.com by ruslan.savchenko on 12 Jan 2010 at 8:01

GoogleCodeExporter commented 9 years ago
I've done merge sort implementation but it lacks performance when the data is 
large
(more than 9000 elements running on my core2duo)
When number of elements is small it is two times faster than qsort and when the 
data
is large it is slower by factor two.

I think the reason is qsort is more cache-friendly than merge sort.

Anyway the code is attached, feel free to play with it.

Original comment by ruslan.savchenko on 13 Mar 2010 at 6:24

Attachments: