| File | /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/Class/MOP/Object.pm |
| Statements Executed | 280 |
| Statement Execution Time | 966µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 133 | 47 | 5 | 689µs | 2.21ms | Class::MOP::Object::meta |
| 1 | 1 | 1 | 14µs | 17µs | Class::MOP::Object::BEGIN@4 |
| 1 | 1 | 1 | 8µs | 17µs | Class::MOP::Object::BEGIN@5 |
| 1 | 1 | 1 | 8µs | 312µs | Class::MOP::Object::_new |
| 1 | 1 | 1 | 6µs | 30µs | Class::MOP::Object::BEGIN@7 |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Object::dump |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | |||||
| 2 | package Class::MOP::Object; | ||||
| 3 | |||||
| 4 | 3 | 21µs | 2 | 20µs | # spent 17µs (14+3) within Class::MOP::Object::BEGIN@4 which was called
# once (14µs+3µs) by base::import at line 4 # spent 17µs making 1 call to Class::MOP::Object::BEGIN@4
# spent 3µs making 1 call to strict::import |
| 5 | 3 | 21µs | 2 | 26µs | # spent 17µs (8+9) within Class::MOP::Object::BEGIN@5 which was called
# once (8µs+9µs) by base::import at line 5 # spent 17µs making 1 call to Class::MOP::Object::BEGIN@5
# spent 9µs making 1 call to warnings::import |
| 6 | |||||
| 7 | 3 | 135µs | 2 | 54µs | # spent 30µs (6+24) within Class::MOP::Object::BEGIN@7 which was called
# once (6µs+24µs) by base::import at line 7 # spent 30µs making 1 call to Class::MOP::Object::BEGIN@7
# spent 24µs making 1 call to Exporter::import |
| 8 | |||||
| 9 | 1 | 600ns | our $VERSION = '0.98'; | ||
| 10 | 1 | 14µs | $VERSION = eval $VERSION; | ||
| 11 | 1 | 300ns | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 12 | |||||
| 13 | # introspection | ||||
| 14 | |||||
| 15 | # spent 2.21ms (689µs+1.52) within Class::MOP::Object::meta which was called 133 times, avg 17µs/call:
# 51 times (252µs+304µs) by Class::MOP::Class::_immutable_metaclass at line 934 of Class/MOP/Class.pm, avg 11µs/call
# 12 times (56µs+62µs) by Class::MOP::Method::clone at line 538 of Class/MOP.pm, avg 10µs/call
# 12 times (54µs+60µs) by Moose::Exporter::BEGIN@11 at line 678 of Class/MOP.pm, avg 10µs/call
# 10 times (48µs+261µs) by SimpleDB::Client::BEGIN@46 at line 244 of Moose.pm, avg 31µs/call
# 5 times (36µs+42µs) by Moose::Meta::Attribute::new at line 59 of Moose/Meta/Attribute.pm, avg 16µs/call
# 2 times (12µs+13µs) by Class::MOP::Class::_construct_class_instance at line 87 of Class/MOP/Class.pm, avg 13µs/call
# once (12µs+81µs) by Moose::BEGIN@18 at line 30 of Moose/Meta/Class.pm
# once (10µs+48µs) by Moose::Meta::TypeCoercion::BEGIN@8 at line 22 of Moose/Meta/Attribute.pm
# once (5µs+48µs) by Moose::Exporter::BEGIN@11 at line 575 of Class/MOP.pm
# once (5µs+48µs) by Moose::Exporter::BEGIN@11 at line 551 of Class/MOP.pm
# once (5µs+47µs) by Moose::Exporter::BEGIN@11 at line 607 of Class/MOP.pm
# once (5µs+47µs) by Moose::Exporter::BEGIN@11 at line 322 of Class/MOP.pm
# once (8µs+40µs) by Moose::Exporter::BEGIN@11 at line 237 of Class/MOP.pm
# once (5µs+42µs) by Moose::Exporter::BEGIN@11 at line 477 of Class/MOP.pm
# once (5µs+41µs) by Moose::Exporter::BEGIN@11 at line 584 of Class/MOP.pm
# once (5µs+41µs) by Moose::Exporter::BEGIN@11 at line 626 of Class/MOP.pm
# once (5µs+41µs) by Moose::Exporter::BEGIN@11 at line 505 of Class/MOP.pm
# once (5µs+40µs) by Moose::Exporter::BEGIN@11 at line 558 of Class/MOP.pm
# once (5µs+40µs) by Moose::Exporter::BEGIN@11 at line 287 of Class/MOP.pm
# once (9µs+10µs) by Moose::Exporter::BEGIN@11 at line 632 of Class/MOP.pm
# once (9µs+9µs) by Moose::Exporter::BEGIN@11 at line 663 of Class/MOP.pm
# once (5µs+10µs) by Moose::Exporter::BEGIN@11 at line 592 of Class/MOP.pm
# once (6µs+6µs) by Moose::Exporter::BEGIN@11 at line 641 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 517 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 501 of Class/MOP.pm
# once (5µs+6µs) by Moose::BEGIN@18 at line 35 of Moose/Meta/Class.pm
# once (5µs+6µs) by Moose::BEGIN@18 at line 44 of Moose/Meta/Class.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 647 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 523 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 565 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 610 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 495 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 349 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 541 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 529 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 511 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 653 of Class/MOP.pm
# once (5µs+6µs) by Moose::BEGIN@18 at line 49 of Moose/Meta/Class.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 368 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 325 of Class/MOP.pm
# once (5µs+6µs) by Moose::BEGIN@18 at line 37 of Moose/Meta/Class.pm
# once (5µs+6µs) by Moose::BEGIN@18 at line 54 of Moose/Meta/Class.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 358 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 306 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 261 of Class/MOP.pm
# once (5µs+6µs) by Moose::Exporter::BEGIN@11 at line 340 of Class/MOP.pm
# once (5µs+5µs) by Moose::Exporter::BEGIN@11 at line 666 of Class/MOP.pm | ||||
| 16 | 266 | 760µs | require Class::MOP::Class; | ||
| 17 | Class::MOP::Class->initialize(blessed($_[0]) || $_[0]); # spent 1.45ms making 133 calls to Class::MOP::Class::initialize, avg 11µs/call, recursion: max depth 1, time 12µs
# spent 71µs making 133 calls to Scalar::Util::blessed, avg 535ns/call | ||||
| 18 | } | ||||
| 19 | |||||
| 20 | # spent 312µs (8+304) within Class::MOP::Object::_new which was called
# once (8µs+304µs) by Moose::Meta::TypeConstraint::Registry::new at line 29 of Moose/Meta/TypeConstraint/Registry.pm | ||||
| 21 | 1 | 11µs | 2 | 304µs | Class::MOP::class_of(shift)->new_object(@_); # spent 297µs making 1 call to Class::MOP::Class::new_object
# spent 8µs making 1 call to Class::MOP::class_of |
| 22 | } | ||||
| 23 | |||||
| 24 | # RANT: | ||||
| 25 | # Cmon, how many times have you written | ||||
| 26 | # the following code while debugging: | ||||
| 27 | # | ||||
| 28 | # use Data::Dumper; | ||||
| 29 | # warn Dumper $obj; | ||||
| 30 | # | ||||
| 31 | # It can get seriously annoying, so why | ||||
| 32 | # not just do this ... | ||||
| 33 | sub dump { | ||||
| 34 | my $self = shift; | ||||
| 35 | require Data::Dumper; | ||||
| 36 | local $Data::Dumper::Maxdepth = shift || 1; | ||||
| 37 | Data::Dumper::Dumper $self; | ||||
| 38 | } | ||||
| 39 | |||||
| 40 | 1 | 4µs | 1; | ||
| 41 | |||||
| 42 | __END__ | ||||
| 43 | |||||
| 44 | =pod | ||||
| 45 | |||||
| 46 | =head1 NAME | ||||
| 47 | |||||
| 48 | Class::MOP::Object - Base class for metaclasses | ||||
| 49 | |||||
| 50 | =head1 DESCRIPTION | ||||
| 51 | |||||
| 52 | This class is a very minimal base class for metaclasses. | ||||
| 53 | |||||
| 54 | =head1 METHODS | ||||
| 55 | |||||
| 56 | This class provides a few methods which are useful in all metaclasses. | ||||
| 57 | |||||
| 58 | =over 4 | ||||
| 59 | |||||
| 60 | =item B<< Class::MOP::???->meta >> | ||||
| 61 | |||||
| 62 | This returns a L<Class::MOP::Class> object. | ||||
| 63 | |||||
| 64 | =item B<< $metaobject->dump($max_depth) >> | ||||
| 65 | |||||
| 66 | This method uses L<Data::Dumper> to dump the object. You can pass an | ||||
| 67 | optional maximum depth, which will set C<$Data::Dumper::Maxdepth>. The | ||||
| 68 | default maximum depth is 1. | ||||
| 69 | |||||
| 70 | =back | ||||
| 71 | |||||
| 72 | =head1 AUTHORS | ||||
| 73 | |||||
| 74 | Stevan Little E<lt>stevan@iinteractive.comE<gt> | ||||
| 75 | |||||
| 76 | =head1 COPYRIGHT AND LICENSE | ||||
| 77 | |||||
| 78 | Copyright 2006-2010 by Infinity Interactive, Inc. | ||||
| 79 | |||||
| 80 | L<http://www.iinteractive.com> | ||||
| 81 | |||||
| 82 | This library is free software; you can redistribute it and/or modify | ||||
| 83 | it under the same terms as Perl itself. | ||||
| 84 | |||||
| 85 | =cut |