which is why i don't send in patches for this type of thing (slow but not broken). the actual fastest i've found is almost the most simple...
use Socket qw( inet_aton inet_ntoa ); sub sort_sock { map { inet_ntoa($_) } sort map { inet_aton($_) } @_ }
which give me:
s/iter faster tye sock
faster 2.06 -- -29% -64%
tye 1.46 41% -- -49%
sock 0.737 179% 98% --
can it get better? will locale settings mess with the sort? will Unicode bite me? i'm unsure.
In reply to Re^9: [IP Sorting] Anyone use "xor" in conditionals? (faster)
by zengargoyle
in thread Anyone use "xor" in conditionals?
by bsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |