Created
July 7, 2012 14:12
-
-
Save syohex/3066600 to your computer and use it in GitHub Desktop.
Benchmark to getting methods list between Class::Inspector and Class::MOP::Class
This file contains hidden or 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
#!perl | |
use strict; | |
use warnings; | |
use Class::Inspector; | |
use Moose; | |
use LWP::UserAgent; | |
use Benchmark qw/cmpthese/; | |
cmpthese(-5, { | |
inspector => sub { | |
Class::Inspector->methods('LWP::UserAgent'); | |
}, | |
mop => sub { | |
Class::MOP::Class->initialize('LWP::UserAgent')->get_method_list; | |
}, | |
}); | |
__DATA__ | |
Rate inspector mop | |
inspector 10578/s -- -97% | |
mop 348984/s 3199% -- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment