3 use Benchmark qw(:all);
4 use Config; printf "Perl/%vd in $Config{archname}\n\n", $^V;
8 my $cxsa_is_loaded = eval q{
21 sub new { bless {}, shift }
35 __PACKAGE__->meta->make_immutable;
48 __PACKAGE__->meta->make_immutable;
51 use B qw(svref_2object);
53 print "Moose/$Moose::VERSION (Class::MOP/$Class::MOP::VERSION)\n";
54 print "Mouse/$Mouse::VERSION\n";
55 print "Class::XSAccessor/$Class::XSAccessor::VERSION\n" if $cxsa_is_loaded;
57 my $mi = MouseOne->new();
58 my $mx = MooseOne->new();
60 $cx = CXSA->new if $cxsa_is_loaded;
63 print "\nGETTING for simple attributes\n";
76 'C::XSAccessor' => sub{
84 print "\nSETTING for simple attributes\n";
95 'C::XSAccessor' => sub{
103 print "\nGETTING for lazy attributes (except for C::XSAccessor)\n";
107 $x = $mi->with_lazy();
108 $x = $mi->with_lazy();
112 $x = $mx->with_lazy();
113 $x = $mx->with_lazy();
116 'C::XSAccessor' => sub{