Filename | /Users/dde/HackaMol_devel/HackaMol/examples/Atom-timer.pl |
Statements | Executed 100026 statements in 889ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
50000 | 1 | 1 | 136ms | 3.02s | __ANON__[examples/Atom-timer.pl:31] | main::
50000 | 1 | 1 | 134ms | 2.54s | __ANON__[examples/Atom-timer.pl:32] | main::
1 | 1 | 1 | 2.94ms | 3.21ms | BEGIN@4 | main::
3686 | 44 | 31 | 2.64ms | 2.64ms | isa (xsub) | UNIVERSAL::
979 | 1 | 1 | 2.52ms | 79.8ms | around (recurses: max depth 3, inclusive time 583µs) | Class::MOP::Class:::
223 | 1 | 1 | 2.22ms | 93.6ms | try {...} | Class::MOP::Attribute::
1 | 1 | 1 | 1.91ms | 3.66ms | BEGIN@3 | main::
1844 | 37 | 21 | 1.31ms | 1.31ms | can (xsub) | UNIVERSAL::
129 | 1 | 1 | 830µs | 54.6ms | try {...} | Class::MOP::Method::Accessor::
1 | 1 | 1 | 742µs | 725ms | BEGIN@5 | main::
151 | 1 | 1 | 666µs | 291ms | try {...} | Class::MOP::Class::
1 | 1 | 1 | 528µs | 13.3ms | BEGIN@1 | main::
1 | 1 | 1 | 455µs | 1.81ms | BEGIN@2 | main::
22 | 1 | 1 | 161µs | 218ms | try {...} | Class::Load::
61 | 1 | 1 | 161µs | 23.1ms | try {...} | Moose::Meta::Method::Accessor::
17 | 17 | 13 | 128µs | 128µs | VERSION (xsub) | UNIVERSAL::
8 | 2 | 1 | 97µs | 151ms | before | Class::MOP::Class:::
3 | 3 | 1 | 81µs | 81µs | CORE:prtf (opcode) | main::
31 | 1 | 1 | 78µs | 22.6ms | try {...} | Class::MOP::Method::Constructor::
25 | 1 | 1 | 63µs | 89µs | try {...} | Moose::Util::
4 | 4 | 1 | 31µs | 31µs | CORE:print (opcode) | main::
4 | 1 | 1 | 16µs | 24µs | after | Class::MOP::Class:::
3 | 1 | 1 | 14µs | 2.70ms | try {...} | Module::Implementation::
4 | 1 | 1 | 10µs | 284µs | try {...} | Moose::Meta::Attribute::
6 | 1 | 1 | 8µs | 8µs | SvREADONLY (xsub) | Internals::
1 | 1 | 1 | 7µs | 148µs | try {...} | Moose::Meta::Method::Destructor::
1 | 1 | 1 | 5µs | 5µs | (bool (xsub) | version::
1 | 1 | 1 | 4µs | 16µs | catch {...} | Class::Load::
1 | 1 | 1 | 3µs | 3µs | (cmp (xsub) | version::
0 | 0 | 0 | 0s | 0s | RUNTIME | main::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
0 | 100000 | 286ms | Profile data that couldn't be associated with a specific line: # spent 286ms making 100000 calls to Atom::DESTROY, avg 3µs/call | ||
1 | 2 | 192ms | 2 | 13.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 # spent 13.3ms making 1 call to main::BEGIN@1
# spent 98µs making 1 call to Modern::Perl::import |
2 | 2 | 98µs | 2 | 1.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 # spent 1.81ms making 1 call to main::BEGIN@2
# spent 48µs making 1 call to lib::import |
3 | 2 | 92µs | 2 | 5.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 # spent 3.66ms making 1 call to main::BEGIN@3
# spent 1.44ms making 1 call to Time::HiRes::import |
4 | 2 | 93µs | 2 | 3.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 # spent 3.21ms making 1 call to main::BEGIN@4
# spent 91µs making 1 call to Benchmark::import |
5 | 2 | 677µs | 1 | 725ms | # spent 725ms (742µs+724) within main::BEGIN@5 which was called:
# once (742µs+724ms) by main::RUNTIME at line 5 # spent 725ms making 1 call to main::BEGIN@5 |
6 | |||||
7 | 1 | 300ns | my $natoms = 100000; | ||
8 | 1 | 31µs | 1 | 15µs | print "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 | |||||
10 | 1 | 14µs | 1 | 10µs | my $t1 = time; # spent 10µs making 1 call to Time::HiRes::time |
11 | my @atoms = map{ | ||||
12 | 1 | 161ms | 100000 | 5.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 | |||||
15 | 1 | 24µs | 1 | 9µs | my $t2 = time; # spent 9µs making 1 call to Time::HiRes::time |
16 | 1 | 61µs | 1 | 50µs | printf ("time to load $natoms atoms: %10.3f\n", $t2-$t1); # spent 50µs making 1 call to main::CORE:prtf |
17 | |||||
18 | 1 | 121ms | 100000 | 169ms | $_->push_coords([2.000 ,2.000,2.000]) foreach @atoms; # spent 169ms making 100000 calls to Atom::push_coords, avg 2µs/call |
19 | 1 | 6µs | 1 | 2µs | my $t3 = time; # spent 2µs making 1 call to Time::HiRes::time |
20 | 1 | 30µs | 1 | 15µs | printf ("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 | |||||
22 | 1 | 136ms | 100000 | 445ms | $_->set_coords(0,[1.000 ,1.000,1.000]) foreach @atoms; # spent 445ms making 100000 calls to Atom::set_coords, avg 4µs/call |
23 | 1 | 6µs | 1 | 2µs | my $t4 = time; # spent 2µs making 1 call to Time::HiRes::time |
24 | 1 | 30µs | 1 | 15µs | printf ("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 | |||||
26 | 1 | 8µs | 1 | 5µs | print "dump the last atom: ", $#atoms, "\n"; # spent 5µs making 1 call to main::CORE:print |
27 | 1 | 30µs | 2 | 4.70ms | print $atoms[$#atoms]->dump; # spent 4.69ms making 1 call to Moose::Object::dump
# spent 9µs making 1 call to main::CORE:print |
28 | |||||
29 | 1 | 5µs | 1 | 2µs | print "construction comparison benchmarks Z vs Symbol\n"; # spent 2µs making 1 call to main::CORE:print |
30 | 50000 | 139ms | 50000 | 2.88s | cmpthese (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 | ||||
32 | 50000 | 139ms | 50000 | 2.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 # spent 2.40s making 50000 calls to Atom::new, avg 48µs/call |
33 | } | ||||
34 | 1 | 12µs | 1 | 6.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 | |||||
# 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 | |||||
# 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 | |||||
# 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 main::CORE:print; # opcode | |||||
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 | |||||
# spent 3µs within version::(cmp which was called:
# once (3µs+0s) by lib::BEGIN@6 at line 62 of Config.pm |