Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Fast data structure..!!!

by Thilosophy (Curate)
on Apr 16, 2008 at 01:20 UTC ( #680711=note: print w/ replies, xml ) Need Help??


in reply to Fast data structure..!!!

Pre-sizing the hash so that it does not need to expand dynamically should save a lot of time.

Also, try to get rid of the nesting in the hash by concatenating the components of the key and using the concatenation as key to a flat hash.

If that is still not fast enough, you will probably have to implement your own hash in C, or reconsider if you can come up with a clever algorithm that does not depend on instant access to a huge data structure (do you really need all that data?)


Comment on Re: Fast data structure..!!!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2015-07-29 10:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls