Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: How to process with huge data's

by Anonymous Monk
on Oct 04, 2011 at 14:48 UTC ( #929561=note: print w/ replies, xml ) Need Help??


in reply to How to process with huge data's

I don't see major faults in your script, but that much data should easily be calculated within a few minutes, if not seconds. However, here are a few problems.

Drop the $inputtext = $_ assignment, and change your top-level regexps to have an anchor in the beginning:

if (m/^q (\d+) (\d+)/)

Second, the m/\b$fnum\b[^\|]*\b$snum\b/ regexps are forcing the regexp engine to recompile that on almost every run (as the variables change). This is highly inefficient -- the whole if/elsif/else chain should be parsed differently. I'm not sure what the purpose of that block is, but at the very least you can change some of $fnum/$snum into \d+


Comment on Re: How to process with huge data's
Select or Download Code
Re^2: How to process with huge data's
by Anonymous Monk on Oct 04, 2011 at 14:52 UTC

    Er, one major fault after all: You seem to be building a huge string called $connectionText, and running loads of regexps on it. You should look into replacing it -- a hash might be suitable.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://929561]
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: (4)
As of 2014-09-20 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (160 votes), past polls