I get the same results. I'm using ActivePerl v5.6.1 on Win2k on a machine with little memory available. From the results below, I'm guessing you need less than 100MB free.
Hash 1 Rows/Sec: 62500.1 Hash 2 Rows/Sec: 4032.3
But the undef appears to be working nonetheless. I added a <STDIN> at the very top of the program, before the undef and at the very end of the program, and noted the size of perl's process using Task Manager before pressing Enter:
Start of execution: <2MB After one hash: 123MB After two hashes: 131MB
Update: On a machine with more memory:
ActivePerl v5.8.0, WinXP, 640MB available Hash 1 Rows/Sec: 250000.3 Hash 2 Rows/Sec: 250000.3 <2MB 154MB 157MB ActivePerl v5.6.1, WinXP, 640MB available Hash 1 Rows/Sec: 200000.2 Hash 2 Rows/Sec: 200000.2 <2MB 155MB 157MB
The slowdown is definitely related to virtual memory usage, but I don't know why it only affects the second pass.
In reply to Re: perl undef
by ikegami
in thread Use of undef slowing down perl?
by thalej
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |