Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Performance Question

by rbc (Curate)
on May 08, 2002 at 20:38 UTC ( [id://165168]=note: print w/replies, xml ) Need Help??


in reply to Performance Question

I just recently wrote a script that was doing the same thing
with a much smaller sized file yet it didn't run as fast I thought
it should.

Turns out I had a bug in the script.

Here's the buggy script:
... my $tabCount = 0; my $line = ""; while(<>) { ... $tabCount += $#tabs+1; $line .= $_; if ( $tabCount == ENOUGH_TABS ) { print "$line\n"; $tabCount = 0; } }
The bug is that I was not doing
$line = "";
when I was doing
$tabCount = 0;
thus printing a larger $line
everytime and slowing things way down.
I dunno but you might wanna make sure you don't
have a bone head bugs like mine :)
Good luck!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-25 15:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found