bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Judy arrays much faster than standard sort?


From: Pádraig Brady
Subject: Re: Judy arrays much faster than standard sort?
Date: Sun, 17 Jan 2010 13:52:00 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0

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:

address@hidden wc input
1000000 1000000 5659335 input

address@hidden time ./judy < input > output_judy
The JudySL array used 360076 bytes of memory

real 0m0.603s
user 0m0.528s
sys 0m0.028s
address@hidden time sort < input > output_sort

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

address@hidden 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

[Prev in Thread] Current Thread [Next in Thread]