Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: how to speed lookups?

by dragonchild (Archbishop)
on Nov 11, 2008 at 21:01 UTC ( #722994=note: print w/ replies, xml ) Need Help??


in reply to how to speed lookups?

What is $linecontainsbuf{$searchfield} = $line for @validbufs; doing? You're also going to have memory issues because you're, essentially, loading both files into RAM.

Best would be to sort the two files on the relevant keys (using an external sort program), then iterate through the filehandles. Remember - once you've seen something in %valid_bufs, you can't see it again.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?


Comment on Re: how to speed lookups?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (18)
As of 2013-05-22 11:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best material for plates (tableware) is:









    Results (461 votes), past polls