[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Read Speed



> When I use open(IN) ... and while (<IN>), the 200mhz 604 that I get to use
> for a little while =) reads in 1000 lines every 2 minutes- that seems
> REALLY slow to me
Something must be wrong. I have just written a ctags-replacement that
has analysed all my c-sourcecode of 2 years (about 300 files) in 10 
seconds.
But I have the ligthning speedy 7200 :-)

But: output to screen is slow. because for every new line the window 
needs scrolling and must be redrawn completly.
so you may try open(IN) ... and while (<IN>) without screen output.

open (OUT, ">nodup.tab");
> @data = split/\n/,$data;
here you copy all the data and add some additional housekeeping 
informations

>	$data =~ s/$line//;
>	@data = split/\n/,$data;
you do a search&replace over 5 mbyte for every line, perl must store the 
intermediate result (another 5 mbyte)
you repeat that split over 5 mbyte for every line.

If you have 100 chars per line, your script has to move
approx 50000 lines times 5 megbyte = 250 gigabyte!

What do you want to do exactly?

regards
Karsten Meier

---------------------------------------------------------------------
Karsten Meier
EMail krstnmr@ibm.net
WWW: http://www.meier-online.com with following highlights:
 * german MacPerl Primer * XTensions for use with QuarkXPress 
Unsolicited and/or commercial email is not permitted at this address.



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch