Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Nested greps w/ Perl

by kennethk (Abbot)
on Dec 19, 2016 at 22:37 UTC ( [id://1178132]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Nested greps w/ Perl
in thread Nested greps w/ Perl

The problem is largely driven by memory footprint. If you instead run
open my $C_LOC, '<', $C_LOCATIONS_FILE; while (<$C_LOC>) { chomp; $count += /\Q$SEARCH_TERM\E/ && /Z/ } close $C_LOC;
you should see a substantial reduction in time. In order to substantially speed it up past this, you need to avoid readline's buffering, at which point you can implement Matching in huge files.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-25 12:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found