good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
CPU cycles necessary for memory allocation certainly count but they constitute a fairly small percentage of CPU cycles necessary for comparing each and every character in a 75MB file -- roughly 78 million comparisons. That is considerable even if you do them directly in assembly language. I obviously don't know but I'm pretty certain that in Perl every comparison involves at least one function call and those are much more expensive that simple cmp's.
Another way to show that it's not just the memory allocation that matters is to plot a graph showing execution speed vs the size of the read buffer. You'll notice that after a certain point the graph will flatten out and you won't see much improvement no matter how much memory you allocate. --perlplexer In reply to Re: Re: Re: Re: split and sysread()
by perlplexer
|
|