in reply to Use of undef slowing down perl?

(note typo -- need my %testHash1) But yeah, seems weird .. though on my system i got 66666.7 and 71428.6, which are comparable (and the second is faster).

As i understand it, undef'ing half-free's the memory -- that block is still reserved by perl (e.g. it is still not available to some other process on the machine), but it can now be re-used within the perl application. So one would think that the total memory footprint wouldn't really increase at all during the second insert. How does that relate to run-time speed? I'm not sure ...

My other observation was that the undef took just about as long (if not longer) to execute as the whole first set of inserts...

Update: corrected the typo in my typo correction

Replies are listed 'Best First'.
Re^2: Use of undef slowing down perl?
by pg (Canon) on Oct 12, 2005 at 13:41 UTC

    Based on the way he uses testHash1, it should be my %testHash1, not my $testHash1 ;-)

Re^2: Use of undef slowing down perl?
by thalej (Initiate) on Oct 12, 2005 at 13:47 UTC
    Hello Davidrw, What platform (unix/linux/windows) and version of perl are you running? Thanks for your reply! Thalej