Toby Ovod-Everett > Class-Prototyped > perf/package_creation.pl

Download:
Class-Prototyped-1.13.tar.gz

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

&remote_exec($alliter, ' package Pack_%i%; @Pack_%i%::ISA = qw(Class::Prototyped); Pack_%i%->reflect(); ');

&remote_exec($alliter, ' package Pack_%i%; @Pack_%i%::ISA = qw(Class::Prototyped); sub foo {"hi";} Pack_%i%->reflect(); ');

&remote_exec($alliter, ' package Pack_%i%; @Pack_%i%::ISA = qw(Class::Prototyped); Pack_%i%->reflect()->addSlot(foo => sub {"hi";}); ');

&remote_exec($alliter, ' Class::Prototyped->newPackage("Pack_%i%"); Pack_%i%->reflect(); Pack_%i%->reflect->_vivified_methods(0); Pack_%i%->reflect->_autovivify_methods; ');

&remote_exec($alliter,' Class::Prototyped->newPackage("Pack_%i%"); Pack_%i%->reflect->addSlots(); ');

&remote_exec($alliter,' Class::Prototyped->newPackage("Pack_%i%"); Pack_%i%->reflect->addSlots(); Pack_%i%->reflect->addSlots(); Pack_%i%->reflect->addSlots(); Pack_%i%->reflect->addSlots(); Pack_%i%->reflect->addSlots(); ');

&remote_exec($alliter,' Class::Prototyped->newPackage("Pack_%i%"); Pack_%i%->reflect->addSlots(a => sub {"hi";}); ');

&remote_exec($alliter,' Class::Prototyped->newPackage("Pack_%i%"); Pack_%i%->reflect->addSlots(a => sub {"hi";}); Pack_%i%->reflect->addSlots(b => sub {"hi";}); Pack_%i%->reflect->addSlots(c => sub {"hi";}); Pack_%i%->reflect->addSlots(d => sub {"hi";}); Pack_%i%->reflect->addSlots(e => sub {"hi";}); ');

&remote_exec($alliter,' @main::stuff = ( a => sub {"hi";}, b => sub {"hi";}, c => sub {"hi";}, d => sub {"hi";}, e => sub {"hi";}); ',' Class::Prototyped->newPackage("Pack_%i%"); Pack_%i%->reflect->addSlots(@main::stuff); ');

&remote_exec(100_000,' Class::Prototyped->newPackage("Pack"); Pack->reflect->addSlots( [qw(a METHOD)] => sub {"hi";}, [qw(b METHOD)] => sub {"hi";}, [qw(c METHOD)] => sub {"hi";}, [qw(d METHOD)] => sub {"hi";}, [qw(e METHOD)] => sub {"hi";} ); $main::mirror = Pack->reflect; ',' $main::mirror->package; $main::mirror->_slots; ');

&remote_exec(100_000,' Class::Prototyped->newPackage("Pack"); Pack->reflect->addSlots( [qw(a METHOD)] => sub {"hi";}, [qw(b METHOD)] => sub {"hi";}, [qw(c METHOD)] => sub {"hi";}, [qw(d METHOD)] => sub {"hi";}, [qw(e METHOD)] => sub {"hi";} ); $main::mirror = Pack->reflect; ',' ref(${$main::mirror}); { my $tied = tied(%{ ${ $main::mirror } }); $main::mirror->_autovivify_parents unless $tied->vivified_parents; $main::mirror->_autovivify_methods unless $tied->vivified_methods; $tied->slots; } ');

&remote_exec($alliter,' @main::stuff = ( [qw(a METHOD)] => sub {"hi";}, [qw(b METHOD)] => sub {"hi";}, [qw(c METHOD)] => sub {"hi";}, [qw(d METHOD)] => sub {"hi";}, [qw(e METHOD)] => sub {"hi";} ); ',' Class::Prototyped->newPackage("Pack_%i%"); Pack_%i%->reflect->addSlots(@main::stuff); ');

syntax highlighting: