On Mon, Jun 27, 2005 at 06:45:47PM +0100, Dave Mitchell wrote: > I've taken the opportunity of make making Carp.pm even lighter (change > #24995), by moving its pod into a separate file
Ahh, the great POD stripping "optimization" arises from the past. Documentation should be as close to the code it documents as possible to increase the likelyhood they will be updated simultaneously. Moving the POD out to a separate file wrecks this so its an actively harmful optimization. Even moving the POD to an __END__ block, rather than inline, degrades its maintainability. How much load time does this save? By my benchmarks, nothing. Why? Because Perl can parse POD easier than a comment. Its just /^=/ and /^=cut/. How much memory does this save? None. USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND schwern 21170 0.0 0.2 19084 1676 std S 3:50PM 0:00.02 bleadperl -I. -wle use CarpNoPOD; sleep 100 schwern 21171 0.0 0.2 19084 1676 std S 3:50PM 0:00.02 bleadperl -I. -wle use CarpPOD; sleep 100 schwern 21175 0.0 0.1 19032 1056 std S 3:50PM 0:00.00 perl5.8.6 -I. -wle use CarpPOD; sleep 100 schwern 21176 0.0 0.1 19032 1056 std S 3:50PM 0:00.02 perl5.8.6 -I. -wle use CarpNoPOD; sleep 100 (Note, that bleadperl is a little old. 24148. This is on OS X 10.3) Granted I'm using the inaccurate process size method, but if the memory saved is so little that it doesn't register here its not worth the maintenance degredation that POD stripping entails. > I get: > > mem used at end total malloced command > 159904 195136 ./perl -Ilib -MExporter -e 1 > 176330 224251 ./perl -Ilib -e 'use Carp; 1' > > it would appear that Carp uses now 15-30K, assuming that Exporter gets loaded > anyway. How much did it use before? Without that information we don't know what was saved. It would also be nice to see each optimization individually to see if its saving anything. -- Michael G Schwern [EMAIL PROTECTED] http://www.pobox.com/~schwern Ahh email, my old friend. Do you know that revenge is a dish that is best served cold? And it is very cold on the Internet!