Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Performance Question

by rbc (Curate)
on May 08, 2002 at 20:38 UTC ( #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
Node Status?
node history
Node Type: note [id://165168]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2020-03-28 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    To "Disagree to disagree" means to:









    Results (167 votes). Check out past polls.

    Notices?