ISAI student has asked for the wisdom of the Perl Monks concerning the following question:
I am asking this performance and memory footprint-wise. While I can experiment on my own, I'd rather have an analytical answer rather than empiric
The Two packs of code do the same action. Should there be any perforance gap (memory and/or execution time) chunk 1:
chunk 2:my @lines=foo('bar'); foreach my $line (@lines) { $a.=chomp $line ; $b*= getVa($line);# a parsing function }
Assume that @lines is not used anywhere else in the scope of code. I would assume that memory footprintwise, 2nd chunk should be no larger than chunk 1, unless the garbage collection does not work in the wasy I expect it to. I am not sure how should the performance scale. Thanksforeach my $line ( foo('bar') ) { $a.=chomp $line ; $b*= getVa($line);#a parsing function }
Back to
Seekers of Perl Wisdom