Filename | /opt/perl-5.18.1/lib/site_perl/5.18.1/Object/Tiny.pm |
Statements | Executed 15 statements in 393µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 90µs | 94µs | import | Object::Tiny::
1 | 1 | 1 | 21µs | 21µs | BEGIN@4 | Object::Tiny::
1 | 1 | 1 | 16µs | 31µs | BEGIN@3 | Object::Tiny::
1 | 1 | 1 | 4µs | 4µs | new | Object::Tiny::
1 | 1 | 1 | 4µs | 4µs | CORE:match (opcode) | Object::Tiny::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Object::Tiny; | ||||
2 | |||||
3 | 2 | 53µs | 2 | 47µs | # spent 31µs (16+16) within Object::Tiny::BEGIN@3 which was called:
# once (16µs+16µs) by Foo::Object::Tiny::BEGIN@143 at line 3 # spent 31µs making 1 call to Object::Tiny::BEGIN@3
# spent 16µs making 1 call to strict::import |
4 | # spent 21µs within Object::Tiny::BEGIN@4 which was called:
# once (21µs+0s) by Foo::Object::Tiny::BEGIN@143 at line 7 | ||||
5 | 1 | 17µs | require 5.004; | ||
6 | 1 | 6µs | $Object::Tiny::VERSION = '1.08'; | ||
7 | 1 | 222µs | 1 | 21µs | } # spent 21µs making 1 call to Object::Tiny::BEGIN@4 |
8 | |||||
9 | # spent 94µs (90+4) within Object::Tiny::import which was called:
# once (90µs+4µs) by Foo::Object::Tiny::BEGIN@143 at line 143 of fastest.pl | ||||
10 | 1 | 600ns | return unless shift eq 'Object::Tiny'; | ||
11 | 1 | 900ns | my $pkg = caller; | ||
12 | 1 | 4µs | my $child = !! @{"${pkg}::ISA"}; | ||
13 | 1 | 12µs | 1 | 4µs | eval join "\n", # spent 4µs making 1 call to Object::Tiny::CORE:match |
14 | "package $pkg;", | ||||
15 | ($child ? () : "\@${pkg}::ISA = 'Object::Tiny';"), | ||||
16 | map { | ||||
17 | 1 | 62µs | defined and ! ref and /^[^\W\d]\w*\z/s # spent 10µs executing statements in string eval | ||
18 | or die "Invalid accessor name '$_'"; | ||||
19 | 1 | 1µs | "sub $_ { return \$_[0]->{$_} }" | ||
20 | } @_; | ||||
21 | 1 | 100ns | die "Failed to generate $pkg" if $@; | ||
22 | 1 | 6µs | return 1; | ||
23 | } | ||||
24 | |||||
25 | # spent 4µs within Object::Tiny::new which was called:
# once (4µs+0s) by main::RUNTIME at line 145 of fastest.pl | ||||
26 | 1 | 500ns | my $class = shift; | ||
27 | 1 | 5µs | bless { @_ }, $class; | ||
28 | } | ||||
29 | |||||
30 | 1 | 3µs | 1; | ||
31 | |||||
32 | __END__ | ||||
# spent 4µs within Object::Tiny::CORE:match which was called:
# once (4µs+0s) by Object::Tiny::import at line 13 |