Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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
Replies are listed 'Best First'.
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 romping around the Monastery: (11)
As of 2015-07-29 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls