in reply to Re: Sorting IP addresses, lots of them, quickly
in thread Sorting IP addresses, lots of them, quickly
Rate ukeysort grt schwartzian gloryhackish + keysort ukeysort 1.63/s -- -20% -21% -39% + -70% grt 2.04/s 25% -- -0% -23% + -62% schwartzian 2.05/s 26% 0% -- -23% + -62% gloryhackish 2.66/s 63% 30% 30% -- + -51% keysort 5.41/s 232% 165% 163% 103% + --
Somehow, ukeysort went to the back of the line, with GRT not being a whole lot zippier and inconsequentially slower than ST. On a similar machine with just a single P-II/500 and 640M of RAM, though:
Rate schwartzian ukeysort grt gloryhackish + keysort schwartzian 2.28/s -- -22% -27% -42% + -71% ukeysort 2.92/s 28% -- -7% -25% + -63% grt 3.14/s 38% 8% -- -20% + -60% gloryhackish 3.91/s 72% 34% 25% -- + -50% keysort 7.86/s 245% 169% 151% 101% + --
GRT beats ukeysort again and is well ahead of ST. But on an Athlon 3900+ w/1G RAM:
Rate schwartzian grt ukeysort gloryhackish + keysort schwartzian 6.83/s -- -37% -46% -52% + -76% grt 10.9/s 59% -- -13% -24% + -61% ukeysort 12.6/s 84% 16% -- -12% + -55% gloryhackish 14.2/s 108% 31% 13% -- + -50% keysort 28.2/s 312% 159% 124% 98% + --
None of these machines are memory constrained, none are swapping, and none are particularly busy doing other things. All are running the same version of Debian with the stock kernels, running the exact same test code just copied from machine to machine. keysort is always out front, but unlike my AMD64 the gloryhackish stays in the #2 spot every time, while the others wiggle around depending upon the machine used.
'Tis a puzzle, seems to point toward something at a very low level being the source of the disparate numbers. The only conclusion I can come up with is that keysort is the way to go when a large number of IP addresses must be sorted in a time constrained environment, gloryhackish might be a good choice if no non-core module dependencies are allowed, even though it might not always be the second best choice. It's good to know about Sort::Key, in any event.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Sorting IP addresses, lots of them, quickly
by salva (Canon) on May 16, 2007 at 20:58 UTC | |
by salva (Canon) on May 16, 2007 at 23:12 UTC | |
by gloryhack (Deacon) on May 17, 2007 at 03:57 UTC | |
by monarch (Priest) on May 17, 2007 at 06:36 UTC | |
by salva (Canon) on May 21, 2007 at 17:31 UTC | |
by salva (Canon) on May 17, 2007 at 06:53 UTC |