Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: how to speed lookups?

by duckyd (Hermit)
on Nov 12, 2008 at 00:45 UTC ( #723034=note: print w/replies, xml ) Need Help??


in reply to how to speed lookups?

A couple of other changes you might consider are using a hash to check if a line is one that should be kept, and outputting lines you want to keep immediately, rather than accumulating them all in memory:
my %validbufs = map { $_ => 1 } @validbufs; while ($line = <BUFFER>) { $searchfield=(split /\'/,$line)[1]; print $line if $validbufs{$searchfield} }

Replies are listed 'Best First'.
Re^2: how to speed lookups?
by lukka (Novice) on Nov 12, 2008 at 11:44 UTC
    Thank you very much for the suggestions. I will try them out. This forum is awesome!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2021-04-11 01:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?