|Problems? Is your data what you think it is?|
Garbage collection at subroutine returnby tcarmeli (Beadle)
|on Feb 15, 2007 at 13:19 UTC||Need Help??|
tcarmeli has asked for the wisdom of the Perl Monks concerning the following question:
Please look at the following short example.
It measures (hopefully...) the time it takes perl to return from the DoIt subroutine. If you scale the value of $max, the time will expand linearily (well, at least on ActivePerl 5.8.8 on XP OS).
Is there any way to reduce this time?
For those that needed more explanations:
This is the problem re-defined:
When calling a sub that uses large data structures (no matter what it does), what general measures one can to reduce the effect of the garbage collection.
For a good answer, see liverpole's below.