Skip to content

Instantly share code, notes, and snippets.

@syohex
Created July 7, 2012 14:12
Show Gist options
  • Save syohex/3066600 to your computer and use it in GitHub Desktop.
Save syohex/3066600 to your computer and use it in GitHub Desktop.
Benchmark to getting methods list between Class::Inspector and Class::MOP::Class
#!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