Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^6: Hash Search is VERY slow

by Tux (Canon)
on Sep 30, 2021 at 13:07 UTC ( [id://11137137]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Hash Search is VERY slow
in thread Hash Search is VERY slow

I sort hash keys all the time. And IP sorting is easy when you include leading zeroes as you just did, but most IP's I see in log files are without leading zeroes, so ordering them would result in

1.2.3.4 10.2.3.4 104.2.3.4 11.2.3.4 2.2.3.4 23.2.108.4 23.2.3.4 23.2.30.4 23.2.4.4

and IMHO that sucks. Using packed keys sorting is always correct. If it is faster? No idea, Icould bench that, but I expect it to be marginal

Side note: I *always* sort hash keys in tests, as order is randow


Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^7: Hash Search is VERY slow
by LanX (Saint) on Sep 30, 2021 at 14:30 UTC
    OK thanks, I see.

    was confused b/c the thread was about "slowness".

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11137137]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-29 14:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found