Don’t call an early-returning destructor
authorFather Chrysostomos <sprout@cpan.org>
Mon, 21 Nov 2011 16:40:34 +0000 (08:40 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 21 Nov 2011 16:40:34 +0000 (08:40 -0800)
commitc70a25495e335e9b4c9d18536444a9fae0266525
treec20ab2044df74bb57fd573e9da564865c5258dc8
parent46538741db37cc3beb7d7a909a5c15da28a5a933
Don’t call an early-returning destructor

This speeds things up 2.8 times in my naïve benchmarks.

This applies to code like:

    use constant DEBUG => 1;
    DESTROY { return unless DEBUG; ... }

which gets optimised down to:

    DESTROY { return; ... }

Adding such a destructor will now have almost no impact on speed in
production.
sv.c