Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Small Hash a Gateway to Large Hash?

by lsherwood (Beadle)
on Feb 18, 2014 at 21:49 UTC ( [id://1075390]=note: print w/replies, xml ) Need Help??


in reply to Re: Small Hash a Gateway to Large Hash?
in thread Small Hash a Gateway to Large Hash?

Rolf-

Your solution is intriguing. We don't see evidence of swapping to disk, but certainly is something to keep in mind.

  • Comment on Re^2: Small Hash a Gateway to Large Hash?

Replies are listed 'Best First'.
Re^3: Small Hash a Gateway to Large Hash?
by LanX (Saint) on Feb 18, 2014 at 23:55 UTC
    • No swapping means your hash is kept in RAM.

    • Noticeable collisions are very unlikely so accessing this hash can't be done faster.

    • You said the hash is only build once and start-up time is no problem, so writing and rehashing doesn't byte you.

    • You said you are reading and processing many files... thats the most likely place for optimization.

    But without profiling this is only shooting in the dark

    Could it be that you are parsing the files and checking if entries match against the hash?

    Then trie-optimized regexes could be very performant... (you might need runs with several regexes to avoid buffer overruns, but 10000 short strings should fit)

    But w/o much info that's again shooting in the dark.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      trie-optimized regexes could be very performant

      No, they couldn't. Follow your own advice and profile. The results will correct your mis-impression.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-19 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found