On 16/01/10 18:08, Leszek Dubiel wrote:

I have found that Judy arrays are faster than standard "sort" program
about 10 times. This is a little bit strange, because I expected sort to
be fastest tool ever.

Heres is my session:

les...@jowisz$ wc input
1000000 1000000 5659335 input

les...@jowisz$ time ./judy < input > output_judy
The JudySL array used 360076 bytes of memory

real 0m0.603s
user 0m0.528s
sys 0m0.028s
les...@jowisz$ time sort < input > output_sort

real 0m6.026s
user 0m5.912s
sys 0m0.072s

les...@jowisz$ diff output_*

It could be due to the locale your using?
Enforcing a C locale shows they're about the same:

$ gcc JudySort.c -I ../../ -L../../ -lJudy -o JudySort
$ find /usr/share/doc/ -name "*.html" | xargs cat >txt.in
$ l txt.in
-rw-rw-r-- 1 padraig 85,954,410 Jan 17 13:48 txt.in
$ LANG=C time sort < txt.in >/dev/null
3.43user 0.84system 0:04.31elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
$ LANG=C time ./JudySort < txt.in >/dev/null
The JudySL array used 51180524 bytes of memory
4.04user 0.18system 0:04.26elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k

cheers,
Pádraig.


Reply via email to