← Index
NYTProf Performance Profile   « line view »
For examples/Atom-timer.pl
  Run on Mon Aug 12 14:45:28 2013
Reported on Mon Aug 12 14:46:13 2013

Filename/Users/dde/HackaMol_devel/HackaMol/examples/Atom-timer.pl
StatementsExecuted 100026 statements in 889ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
5000011136ms3.02smain::::__ANON__[examples/Atom-timer.pl:31] main::__ANON__[examples/Atom-timer.pl:31]
5000011134ms2.54smain::::__ANON__[examples/Atom-timer.pl:32] main::__ANON__[examples/Atom-timer.pl:32]
1112.94ms3.21msmain::::BEGIN@4 main::BEGIN@4
368644312.64ms2.64msUNIVERSAL::::isa UNIVERSAL::isa (xsub)
979112.52ms79.8msClass::MOP::Class:::::around Class::MOP::Class:::around (recurses: max depth 3, inclusive time 583µs)
223112.22ms93.6msClass::MOP::Attribute::::try {...} Class::MOP::Attribute::try {...}
1111.91ms3.66msmain::::BEGIN@3 main::BEGIN@3
184437211.31ms1.31msUNIVERSAL::::can UNIVERSAL::can (xsub)
12911830µs54.6msClass::MOP::Method::Accessor::::try {...} Class::MOP::Method::Accessor::try {...}
111742µs725msmain::::BEGIN@5 main::BEGIN@5
15111666µs291msClass::MOP::Class::::try {...} Class::MOP::Class::try {...}
111528µs13.3msmain::::BEGIN@1 main::BEGIN@1
111455µs1.81msmain::::BEGIN@2 main::BEGIN@2
2211161µs218msClass::Load::::try {...} Class::Load::try {...}
6111161µs23.1msMoose::Meta::Method::Accessor::::try {...} Moose::Meta::Method::Accessor::try {...}
171713128µs128µsUNIVERSAL::::VERSION UNIVERSAL::VERSION (xsub)
82197µs151msClass::MOP::Class:::::before Class::MOP::Class:::before
33181µs81µsmain::::CORE:prtf main::CORE:prtf (opcode)
311178µs22.6msClass::MOP::Method::Constructor::::try {...} Class::MOP::Method::Constructor::try {...}
251163µs89µsMoose::Util::::try {...} Moose::Util::try {...}
44131µs31µsmain::::CORE:print main::CORE:print (opcode)
41116µs24µsClass::MOP::Class:::::after Class::MOP::Class:::after
31114µs2.70msModule::Implementation::::try {...} Module::Implementation::try {...}
41110µs284µsMoose::Meta::Attribute::::try {...} Moose::Meta::Attribute::try {...}
6118µs8µsInternals::::SvREADONLY Internals::SvREADONLY (xsub)
1117µs148µsMoose::Meta::Method::Destructor::::try {...} Moose::Meta::Method::Destructor::try {...}
1115µs5µsversion::::(bool version::(bool (xsub)
1114µs16µsClass::Load::::catch {...} Class::Load::catch {...}
1113µs3µsversion::::(cmp version::(cmp (xsub)
0000s0smain::::RUNTIME main::RUNTIME
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
0100000286msProfile data that couldn't be associated with a specific line:
# spent 286ms making 100000 calls to Atom::DESTROY, avg 3µs/call
12192ms213.4ms
# spent 13.3ms (528µs+12.8) within main::BEGIN@1 which was called: # once (528µs+12.8ms) by main::RUNTIME at line 1
use Modern::Perl;
# spent 13.3ms making 1 call to main::BEGIN@1 # spent 98µs making 1 call to Modern::Perl::import
2298µs21.85ms
# spent 1.81ms (455µs+1.35) within main::BEGIN@2 which was called: # once (455µs+1.35ms) by main::RUNTIME at line 2
use lib 'lib/HackaMol';
# spent 1.81ms making 1 call to main::BEGIN@2 # spent 48µs making 1 call to lib::import
3292µs25.10ms
# spent 3.66ms (1.91+1.75) within main::BEGIN@3 which was called: # once (1.91ms+1.75ms) by main::RUNTIME at line 3
use Time::HiRes qw(time);
# spent 3.66ms making 1 call to main::BEGIN@3 # spent 1.44ms making 1 call to Time::HiRes::import
4293µs23.30ms
# spent 3.21ms (2.94+274µs) within main::BEGIN@4 which was called: # once (2.94ms+274µs) by main::RUNTIME at line 4
use Benchmark qw(cmpthese);
# spent 3.21ms making 1 call to main::BEGIN@4 # spent 91µs making 1 call to Benchmark::import
52677µs1725ms
# spent 725ms (742µs+724) within main::BEGIN@5 which was called: # once (742µs+724ms) by main::RUNTIME at line 5
use Atom;
# spent 725ms making 1 call to main::BEGIN@5
6
71300nsmy $natoms = 100000;
8131µs115µsprint "Atom-timer will time the construction of and array of $natoms atoms to give idea about speed\n";
# spent 15µs making 1 call to main::CORE:print
9
10114µs110µsmy $t1 = time;
# spent 10µs making 1 call to Time::HiRes::time
11my @atoms = map{
121161ms1000005.86s Atom->new(name => 'Mercury', coord => [0,0,0], symbol => "HG")
# spent 5.86s making 100000 calls to Atom::new, avg 59µs/call
13 } 1 .. $natoms;
14
15124µs19µsmy $t2 = time;
# spent 9µs making 1 call to Time::HiRes::time
16161µs150µsprintf ("time to load $natoms atoms: %10.3f\n", $t2-$t1);
# spent 50µs making 1 call to main::CORE:prtf
17
181121ms100000169ms$_->push_coords([2.000 ,2.000,2.000]) foreach @atoms;
# spent 169ms making 100000 calls to Atom::push_coords, avg 2µs/call
1916µs12µsmy $t3 = time;
# spent 2µs making 1 call to Time::HiRes::time
20130µs115µsprintf ("time to push_coords( [2.000,2.000,2.000] ) for $natoms atoms: %10.3f\n", $t3-$t2);
# spent 15µs making 1 call to main::CORE:prtf
21
221136ms100000445ms$_->set_coords(0,[1.000 ,1.000,1.000]) foreach @atoms;
# spent 445ms making 100000 calls to Atom::set_coords, avg 4µs/call
2316µs12µsmy $t4 = time;
# spent 2µs making 1 call to Time::HiRes::time
24130µs115µsprintf ("time to set_coords(0, [1.000 ,1.000,1.000]) for $natoms atoms: %10.3f\n", $t4-$t3);
# spent 15µs making 1 call to main::CORE:prtf
25
2618µs15µsprint "dump the last atom: ", $#atoms, "\n";
# spent 5µs making 1 call to main::CORE:print
27130µs24.70msprint $atoms[$#atoms]->dump;
# spent 4.69ms making 1 call to Moose::Object::dump # spent 9µs making 1 call to main::CORE:print
28
2915µs12µsprint "construction comparison benchmarks Z vs Symbol\n";
# spent 2µs making 1 call to main::CORE:print
3050000139ms500002.88scmpthese (50000, {
# spent 2.88s making 50000 calls to Atom::new, avg 58µs/call
31
# spent 3.02s (136ms+2.88) within main::__ANON__[examples/Atom-timer.pl:31] which was called 50000 times, avg 60µs/call: # 50000 times (136ms+2.88s) by Benchmark::__ANON__[(eval 336)[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/5.18.0/Benchmark.pm:646]:1] at line 1 of (eval 333)[Benchmark.pm:646], avg 60µs/call
'symb construct' => sub{my $atom = Atom->new(name=>'shit', coord => [0,0,0], symbol => "HG" ) },
3250000139ms500002.40s
# spent 2.54s (134ms+2.40) within main::__ANON__[examples/Atom-timer.pl:32] which was called 50000 times, avg 51µs/call: # 50000 times (134ms+2.40s) by Benchmark::__ANON__[(eval 334)[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/5.18.0/Benchmark.pm:646]:1] at line 1 of (eval 333)[Benchmark.pm:646], avg 51µs/call
'Z construct' => sub{my $atom = Atom->new(name=>'shit', coord => [0,0,0], Z => 80 ) },
# spent 2.40s making 50000 calls to Atom::new, avg 48µs/call
33 }
34112µs16.68s );
# spent 6.68s making 1 call to Benchmark::cmpthese
35
- -
 
# spent 8µs within Internals::SvREADONLY which was called 6 times, avg 1µs/call: # 6 times (8µs+0s) by constant::import at line 136 of constant.pm, avg 1µs/call
sub Internals::SvREADONLY; # xsub
# spent 128µs within UNIVERSAL::VERSION which was called 17 times, avg 8µs/call: # once (12µs+0s) by namespace::autoclean::BEGIN@13 at line 13 of namespace/autoclean.pm # once (9µs+0s) by Moose::Util::BEGIN@12 at line 12 of Moose/Util.pm # once (8µs+0s) by Data::OptList::BEGIN@11 at line 11 of Data/OptList.pm # once (8µs+0s) by String::RewritePrefix::BEGIN@11 at line 13 of String/RewritePrefix.pm # once (8µs+0s) by Moose::Deprecated::BEGIN@12 at line 19 of Moose/Deprecated.pm # once (8µs+0s) by Class::Load::BEGIN@9 at line 9 of Class/Load.pm # once (8µs+0s) by namespace::autoclean::BEGIN@16 at line 16 of namespace/autoclean.pm # once (8µs+0s) by Module::Implementation::BEGIN@12 at line 12 of Module/Implementation.pm # once (7µs+0s) by Moose::Exporter::BEGIN@17 at line 17 of Moose/Exporter.pm # once (7µs+0s) by Class::Load::XS::BEGIN@9 at line 9 of Class/Load/XS.pm # once (7µs+0s) by Sub::Exporter::BEGIN@11 at line 11 of Sub/Exporter.pm # once (7µs+0s) by Class::MOP::BEGIN@18 at line 18 of Class/MOP.pm # once (7µs+0s) by Package::Stash::BEGIN@15 at line 15 of Package/Stash.pm # once (7µs+0s) by Class::Load::BEGIN@10 at line 15 of Class/Load.pm # once (6µs+0s) by Sub::Exporter::BEGIN@12 at line 12 of Sub/Exporter.pm # once (6µs+0s) by Sub::Exporter::BEGIN@13 at line 13 of Sub/Exporter.pm # once (5µs+0s) by Module::Runtime::use_module at line 349 of Module/Runtime.pm
sub UNIVERSAL::VERSION; # xsub
# spent 1.31ms within UNIVERSAL::can which was called 1844 times, avg 712ns/call: # 410 times (244µs+0s) by Class::MOP::Class::_single_metaclass_can_be_made_compatible at line 354 of Class/MOP/Class.pm, avg 596ns/call # 189 times (126µs+0s) by Class::MOP::Mixin::HasAttributes::add_attribute at line 44 of Class/MOP/Mixin/HasAttributes.pm, avg 668ns/call # 187 times (155µs+0s) by Class::MOP::Method::Generated::_compile_code at line 59 of Class/MOP/Method/Generated.pm, avg 829ns/call # 147 times (104µs+0s) by Moose::Meta::Attribute::_inline_throw_error at line 71 of Moose/Meta/Attribute.pm, avg 704ns/call # 140 times (75µs+0s) by Class::MOP::Class::_single_metaclass_is_compatible at line 287 of Class/MOP/Class.pm, avg 534ns/call # 132 times (74µs+0s) by Moose::Meta::Class::excludes_role at line 273 of Moose/Meta/Class.pm, avg 561ns/call # 120 times (52µs+0s) by Moose::Meta::Class::_call_all_triggers at line 298 of Moose/Meta/Class.pm, avg 429ns/call # 59 times (32µs+0s) by Moose::Meta::Role::Composite::add_method at line 91 of Moose/Meta/Role/Composite.pm, avg 537ns/call # 55 times (39µs+0s) by Class::MOP::Mixin::HasMethods::_add_meta_method at line 28 of Class/MOP/Mixin/HasMethods.pm, avg 704ns/call # 53 times (34µs+0s) by Moose::Meta::Method::Accessor::Native::Collection::_tc_member_type at line 42 of Moose/Meta/Method/Accessor/Native/Collection.pm, avg 651ns/call # 47 times (36µs+0s) by Moose::Meta::Method::_inline_throw_error at line 39 of Moose/Meta/Method.pm, avg 755ns/call # 28 times (27µs+0s) by Moose::Meta::Class::add_attribute at line 583 of Moose/Meta/Class.pm, avg 961ns/call # 26 times (64µs+0s) by Moose::Meta::Attribute::install_delegation at line 1121 of Moose/Meta/Attribute.pm, avg 2µs/call # 26 times (46µs+0s) by Moose::Exporter::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Exporter.pm:519] at line 468 of Moose/Exporter.pm, avg 2µs/call # 26 times (44µs+0s) by Class::MOP::Class:::around at line 178 of Moose/Meta/Attribute/Native/Trait.pm, avg 2µs/call # 26 times (39µs+0s) by Moose::Meta::Attribute::Native::Trait::_check_handles_values at line 134 of Moose/Meta/Attribute/Native/Trait.pm, avg 1µs/call # 22 times (13µs+0s) by Moose::Meta::Class::_inline_init_attr_from_default at line 429 of Moose/Meta/Class.pm, avg 595ns/call # 22 times (12µs+0s) by Moose::Meta::Class::_inline_check_required_attr at line 387 of Moose/Meta/Class.pm, avg 532ns/call # 22 times (11µs+0s) by Moose::Meta::Class::_inline_triggers at line 471 of Moose/Meta/Class.pm, avg 509ns/call # 22 times (9µs+0s) by Moose::Meta::Class::_eval_environment at line 507 of Moose/Meta/Class.pm, avg 427ns/call # 22 times (9µs+0s) by Moose::Meta::Class::_eval_environment at line 521 of Moose/Meta/Class.pm, avg 418ns/call # 21 times (14µs+0s) by Moose::Util::does_role at line 61 of Moose/Util.pm, avg 690ns/call # 9 times (7µs+0s) by Moose::Util::add_method_modifier at line 239 of Moose/Util.pm, avg 733ns/call # 4 times (7µs+0s) by Moose::Object::does at line 125 of Moose/Object.pm, avg 2µs/call # 4 times (6µs+0s) by Moose::Meta::Class::new_object at line 288 of Moose/Meta/Class.pm, avg 1µs/call # 4 times (3µs+0s) by Moose::Meta::Class::__ANON__::SERIAL::1::_native_type at line 11 of (eval 74)[Eval/Closure.pm:135], avg 775ns/call # 3 times (10µs+0s) by Class::MOP::Class:::before at line 30 of Moose/Meta/Attribute/Native/Trait.pm, avg 3µs/call # 3 times (4µs+0s) by Sub::Exporter::default_generator at line 411 of Sub/Exporter.pm, avg 1µs/call # 3 times (3µs+0s) by Moose::Meta::TypeConstraint::Parameterizable::parameterize at line 80 of Moose/Meta/TypeConstraint/Parameterizable.pm, avg 1µs/call # 3 times (3µs+0s) by Moose::Util::TypeConstraints::_create_parameterized_type_constraint at line 143 of Moose/Util/TypeConstraints.pm, avg 967ns/call # 2 times (3µs+0s) by Moose::Util::resolve_metaclass_alias at line 230 of Moose/Util.pm, avg 2µs/call # 2 times (3µs+0s) by if::work at line 14 of if.pm, avg 1µs/call # once (2µs+0s) by Class::MOP::Method::Inlined::can_be_inlined at line 70 of Class/MOP/Method/Inlined.pm # once (1µs+0s) by Sub::Install::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/Sub/Install.pm:132] at line 120 of Sub/Install.pm # once (1µs+0s) by Class::MOP::Method::Inlined::can_be_inlined at line 58 of Class/MOP/Method/Inlined.pm # once (1µs+0s) by MooseX::Storage::import at line 20 of MooseX/Storage.pm # once (900ns+0s) by Moose::Object::BEGIN@108 at line 109 of Moose/Object.pm
sub UNIVERSAL::can; # xsub
# spent 2.64ms within UNIVERSAL::isa which was called 3686 times, avg 715ns/call: # 890 times (450µs+0s) by Class::MOP::Mixin::HasMethods::add_method at line 62 of Class/MOP/Mixin/HasMethods.pm, avg 506ns/call # 526 times (442µs+0s) by Class::MOP::Object::_is_compatible_with at line 52 of Class/MOP/Object.pm, avg 841ns/call # 442 times (209µs+0s) by Class::MOP::Mixin::HasMethods::get_method at line 122 of Class/MOP/Mixin/HasMethods.pm, avg 474ns/call # 249 times (143µs+0s) by Class::MOP::Method::Accessor::new at line 29 of Class/MOP/Method/Accessor.pm, avg 573ns/call # 225 times (236µs+0s) by Moose::Meta::Role::Application::ToRole::apply_methods at line 86 of Moose/Meta/Role/Application/ToRole.pm, avg 1µs/call # 208 times (216µs+0s) by Moose::Meta::Role::Application::ToClass::apply_methods at line 165 of Moose/Meta/Role/Application/ToClass.pm, avg 1µs/call # 189 times (125µs+0s) by Class::MOP::Mixin::HasAttributes::add_attribute at line 23 of Class/MOP/Mixin/HasAttributes.pm, avg 661ns/call # 151 times (73µs+0s) by Class::MOP::Attribute::attach_to_class at line 240 of Class/MOP/Attribute.pm, avg 481ns/call # 96 times (148µs+0s) by Class::MOP::Class::new_object at line 496 of Class/MOP/Class.pm, avg 2µs/call # 81 times (120µs+0s) by base::import at line 74 of base.pm, avg 1µs/call # 71 times (48µs+0s) by Moose::Meta::Role::Application::RoleSummation::apply_methods at line 170 of Moose/Meta/Role/Application/RoleSummation.pm, avg 682ns/call # 67 times (30µs+0s) by Class::MOP::Method::Wrapped::wrap at line 76 of Class/MOP/Method/Wrapped.pm, avg 445ns/call # 49 times (33µs+0s) by Moose::Meta::TypeConstraint::Registry::add_type_constraint at line 51 of Moose/Meta/TypeConstraint/Registry.pm, avg 682ns/call # 38 times (16µs+0s) by Moose::Meta::Role::Attribute::attach_to_role at line 72 of Moose/Meta/Role/Attribute.pm, avg 413ns/call # 31 times (21µs+0s) by Moose::Meta::Role::apply at line 449 of Moose/Meta/Role.pm, avg 684ns/call # 30 times (41µs+0s) by Class::MOP::Method::Inlined::can_be_inlined at line 43 of Class/MOP/Method/Inlined.pm, avg 1µs/call # 30 times (18µs+0s) by Class::MOP::Method::Constructor::new at line 23 of Class/MOP/Method/Constructor.pm, avg 610ns/call # 29 times (14µs+0s) by Moose::Util::TypeConstraints::find_type_constraint at line 312 of Moose/Util/TypeConstraints.pm, avg 479ns/call # 26 times (21µs+0s) by Moose::Meta::Attribute::install_delegation at line 1121 of Moose/Meta/Attribute.pm, avg 819ns/call # 26 times (19µs+0s) by Moose::Util::_apply_all_roles at line 136 of Moose/Util.pm, avg 731ns/call # 25 times (26µs+0s) by Moose::Util::try {...} at line 54 of Moose/Util.pm, avg 1µs/call # 24 times (29µs+0s) by Moose::Exporter::_apply_metaroles at line 575 of Moose/Exporter.pm, avg 1µs/call # 20 times (25µs+0s) by metaclass::import at line 35 of metaclass.pm, avg 1µs/call # 20 times (24µs+0s) by Moose::Meta::Class::superclasses at line 566 of Moose/Meta/Class.pm, avg 1µs/call # 19 times (17µs+0s) by Moose::Role::init_meta at line 122 of Moose/Role.pm, avg 889ns/call # 19 times (12µs+0s) by Moose::Meta::Class::add_attribute at line 576 of Moose/Meta/Class.pm, avg 605ns/call # 19 times (10µs+0s) by Moose::Meta::Role::add_attribute at line 245 of Moose/Meta/Role.pm, avg 532ns/call # 15 times (16µs+0s) by Class::MOP::Class::superclasses at line 949 of Class/MOP/Class.pm, avg 1µs/call # 11 times (6µs+0s) by Moose::Meta::Role::add_role at line 406 of Moose/Meta/Role.pm, avg 591ns/call # 10 times (6µs+0s) by Moose::Meta::Class::add_role_application at line 210 of Moose/Meta/Class.pm, avg 630ns/call # 10 times (6µs+0s) by Moose::Meta::Class::add_role at line 197 of Moose/Meta/Class.pm, avg 570ns/call # 9 times (10µs+0s) by Class::MOP::Class::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Class/MOP/Class.pm:1072] at line 1065 of Class/MOP/Class.pm, avg 1µs/call # 8 times (4µs+0s) by Moose::Meta::Role::Composite::new at line 52 of Moose/Meta/Role/Composite.pm, avg 488ns/call # 4 times (4µs+0s) by Moose::init_meta at line 161 of Moose.pm, avg 925ns/call # 4 times (2µs+0s) by Moose::Meta::Method::Accessor::Native::Collection::_check_new_members_only at line 94 of Moose/Meta/Method/Accessor/Native/Collection.pm, avg 625ns/call # 3 times (2µs+0s) by Moose::Meta::TypeConstraint::Parameterizable::parameterize at line 88 of Moose/Meta/TypeConstraint/Parameterizable.pm, avg 733ns/call # 3 times (2µs+0s) by Moose::Meta::TypeConstraint::Parameterized::compile_type_constraint at line 55 of Moose/Meta/TypeConstraint/Parameterized.pm, avg 533ns/call # 2 times (2µs+0s) by MooseX::Storage::_expand_role at line 62 of MooseX/Storage.pm, avg 1µs/call # 2 times (2µs+0s) by Class::MOP::Mixin::HasMethods::_add_meta_method at line 31 of Class/MOP/Mixin/HasMethods.pm, avg 1µs/call # once (1µs+0s) by Moose::Meta::TypeConstraint::Parameterized::equals at line 36 of Moose/Meta/TypeConstraint/Parameterized.pm # once (1µs+0s) by namespace::autoclean::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/namespace/autoclean.pm:57] at line 46 of namespace/autoclean.pm # once (800ns+0s) by Moose::Meta::Method::Destructor::is_needed at line 61 of Moose/Meta/Method/Destructor.pm # once (700ns+0s) by Moose::Meta::Attribute::_process_accessors at line 1057 of Moose/Meta/Attribute.pm # once (700ns+0s) by Moose::Meta::Attribute::_process_accessors at line 1045 of Moose/Meta/Attribute.pm
sub UNIVERSAL::isa; # xsub
# spent 31µs within main::CORE:print which was called 4 times, avg 8µs/call: # once (15µs+0s) by main::RUNTIME at line 8 # once (9µs+0s) by main::RUNTIME at line 27 # once (5µs+0s) by main::RUNTIME at line 26 # once (2µs+0s) by main::RUNTIME at line 29
sub main::CORE:print; # opcode
# spent 81µs within main::CORE:prtf which was called 3 times, avg 27µs/call: # once (50µs+0s) by main::RUNTIME at line 16 # once (15µs+0s) by main::RUNTIME at line 20 # once (15µs+0s) by main::RUNTIME at line 24
sub main::CORE:prtf; # opcode
# spent 5µs within version::(bool which was called: # once (5µs+0s) by lib::BEGIN@6 at line 59 of Config.pm
sub version::(bool; # xsub
# spent 3µs within version::(cmp which was called: # once (3µs+0s) by lib::BEGIN@6 at line 62 of Config.pm
sub version::(cmp; # xsub