http://www.perlmonks.org?node_id=655493


in reply to Not returning scalars(SV) to optimize and save memory?

Your influences are misleading you. The savings would be so minimal.... Let's put it to the test.
use strict; use warnings; use Benchmark qw( cmpthese ); use constant TRUE => 1 == 1; use constant FALSE => 1 == 0; sub old_foo { return 0; } sub new_foo { return; } cmpthese(-3, { old_foo => 'old_foo(); 1', new_foo => 'new_foo(); 1', }); sub old_bar { return 1; } sub new_bar { return TRUE; } cmpthese(-3, { old_bar => 'old_bar(); 1', new_bar => 'new_bar(); 1', });

The results fluctuated too much. Sometimes one is 20% faster than the other, sometimes it's the other way around. In other words, they are both so fast that the time they take is actually dependent on external factors.

By the way, new_foo isn't even equivalent to old_foo.