Created
March 14, 2014 14:39
-
-
Save tsee/9548987 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here's the results of the following benchmark run on various non-threaded, | |
-O2 perls: | |
{ | |
package O; | |
use overload '""' => sub {}; | |
} | |
my $obj = bless {'x'}, 'P'; | |
my $obj_overload = bless {'x'}, 'O'; | |
use Benchmark qw(:all); | |
cmpthese(0, { | |
'obj' => sub { $obj->{x} }, | |
'obj_overload' => sub { $obj_overload->{x} }, | |
}); | |
5.19.8 | |
obj_overload 11522142/s -- -47% | |
obj 21608502/s 88% -- | |
my branch | |
obj_overload 19891968/s -- -12% | |
obj 22647021/s 14% -- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment