January 2019 Archives

Is there anything wrong with this benchmark?

Class::Method::Modifiers versus $self->SUPER.

The exec summary is:

$ dumbbench perl test1.pl 
cmd: Ran 21 iterations (1 outliers).
cmd: Rounded run time per iteration: 2.0408e-02 +/- 3.6e-05 (0.2%)
$ dumbbench perl test2.pl 
cmd: Ran 22 iterations (2 outliers).
cmd: Rounded run time per iteration: 1.5050e-02 +/- 6.9e-05 (0.5%)

So Class::Method::Modifiers seems 30% faster. I'm guessing that this is the result of not having the subroutine overhead call on every invocation. Am I right? How does this work?

About kd

user-pic Australian perl hacker. Lead author of the Definitive Guide to Catalyst. Dabbles in javascript, social science and statistical analysis. Seems to have been sucked into the world of cloud and devops.