Filename | /home/micha/.plenv/versions/5.38.2/lib/perl5/site_perl/5.38.2/Test2/Event/V2.pm |
Statements | Executed 41 statements in 472µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 595µs | 1.71ms | BEGIN@12 | Test2::Event::V2::
1 | 1 | 1 | 24µs | 28µs | facet_data | Test2::Event::V2::
1 | 1 | 1 | 11µs | 12µs | BEGIN@2 | Test2::Event::V2::
1 | 1 | 1 | 7µs | 11µs | init | Test2::Event::V2::
1 | 1 | 1 | 6µs | 6µs | BEGIN@10 | Test2::Event::V2::
1 | 1 | 1 | 6µs | 40µs | BEGIN@17 | Test2::Event::V2::
1 | 1 | 1 | 4µs | 21µs | BEGIN@7 | Test2::Event::V2::
1 | 1 | 1 | 4µs | 20µs | BEGIN@3 | Test2::Event::V2::
1 | 1 | 1 | 3µs | 15µs | BEGIN@8 | Test2::Event::V2::
1 | 1 | 1 | 1µs | 1µs | non_facet_keys | Test2::Event::V2::
0 | 0 | 0 | 0s | 0s | set_uuid | Test2::Event::V2::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Test2::Event::V2; | ||||
2 | 2 | 20µs | 2 | 14µs | # spent 12µs (11+2) within Test2::Event::V2::BEGIN@2 which was called:
# once (11µs+2µs) by Test::Builder::BEGIN@18 at line 2 # spent 12µs making 1 call to Test2::Event::V2::BEGIN@2
# spent 2µs making 1 call to strict::import |
3 | 2 | 27µs | 2 | 37µs | # spent 20µs (4+17) within Test2::Event::V2::BEGIN@3 which was called:
# once (4µs+17µs) by Test::Builder::BEGIN@18 at line 3 # spent 20µs making 1 call to Test2::Event::V2::BEGIN@3
# spent 17µs making 1 call to warnings::import |
4 | |||||
5 | 1 | 300ns | our $VERSION = '1.302198'; | ||
6 | |||||
7 | 2 | 16µs | 2 | 37µs | # spent 21µs (4+17) within Test2::Event::V2::BEGIN@7 which was called:
# once (4µs+17µs) by Test::Builder::BEGIN@18 at line 7 # spent 21µs making 1 call to Test2::Event::V2::BEGIN@7
# spent 17µs making 1 call to Exporter::import |
8 | 2 | 29µs | 2 | 27µs | # spent 15µs (3+12) within Test2::Event::V2::BEGIN@8 which was called:
# once (3µs+12µs) by Test::Builder::BEGIN@18 at line 8 # spent 15µs making 1 call to Test2::Event::V2::BEGIN@8
# spent 12µs making 1 call to Exporter::import |
9 | |||||
10 | 2 | 24µs | 1 | 6µs | # spent 6µs within Test2::Event::V2::BEGIN@10 which was called:
# once (6µs+0s) by Test::Builder::BEGIN@18 at line 10 # spent 6µs making 1 call to Test2::Event::V2::BEGIN@10 |
11 | |||||
12 | 1 | 5µs | 1 | 45µs | # spent 1.71ms (595µs+1.11) within Test2::Event::V2::BEGIN@12 which was called:
# once (595µs+1.11ms) by Test::Builder::BEGIN@18 at line 15 # spent 45µs making 1 call to Exporter::import |
13 | causes_fail diagnostics global increments_count no_display sets_plan | ||||
14 | subtest_id summary terminate | ||||
15 | 1 | 82µs | 1 | 1.71ms | }; # spent 1.71ms making 1 call to Test2::Event::V2::BEGIN@12 |
16 | |||||
17 | 2 | 234µs | 2 | 74µs | # spent 40µs (6+35) within Test2::Event::V2::BEGIN@17 which was called:
# once (6µs+35µs) by Test::Builder::BEGIN@18 at line 17 # spent 40µs making 1 call to Test2::Event::V2::BEGIN@17
# spent 34µs making 1 call to Test2::Util::HashBase::import |
18 | |||||
19 | # spent 1µs within Test2::Event::V2::non_facet_keys which was called:
# once (1µs+0s) by Test2::Event::V2::facet_data at line 58 | ||||
20 | return ( | ||||
21 | 1 | 2µs | +UUID, | ||
22 | Test2::Util::ExternalMeta::META_KEY(), | ||||
23 | ); | ||||
24 | } | ||||
25 | |||||
26 | # spent 11µs (7+4) within Test2::Event::V2::init which was called:
# once (7µs+4µs) by Test2::Util::HashBase::_new at line 155 of Test2/Util/HashBase.pm | ||||
27 | 1 | 300ns | my $self = shift; | ||
28 | |||||
29 | 1 | 400ns | my $uuid; | ||
30 | 1 | 2µs | if ($uuid = $self->{+UUID}) { | ||
31 | croak "uuid '$uuid' passed to constructor, but uuid '$self->{+ABOUT}->{uuid}' is already set in the 'about' facet" | ||||
32 | if $self->{+ABOUT}->{uuid} && $self->{+ABOUT}->{uuid} ne $uuid; | ||||
33 | |||||
34 | $self->{+ABOUT}->{uuid} = $uuid; | ||||
35 | } | ||||
36 | elsif ($self->{+ABOUT} && $self->{+ABOUT}->{uuid}) { | ||||
37 | $uuid = $self->{+ABOUT}->{uuid}; | ||||
38 | $self->SUPER::set_uuid($uuid); | ||||
39 | } | ||||
40 | |||||
41 | # Clone the trace, make sure it is blessed | ||||
42 | 1 | 4µs | 1 | 0s | if (my $trace = $self->{+TRACE}) { # spent 4µs making 1 call to Test2::Util::HashBase::_new, recursion: max depth 1, sum of overlapping time 4µs |
43 | $self->{+TRACE} = Test2::EventFacet::Trace->new(%$trace); | ||||
44 | } | ||||
45 | } | ||||
46 | |||||
47 | sub set_uuid { | ||||
48 | my $self = shift; | ||||
49 | my ($uuid) = @_; | ||||
50 | $self->{+ABOUT}->{uuid} = $uuid; | ||||
51 | $self->SUPER::set_uuid($uuid); | ||||
52 | } | ||||
53 | |||||
54 | # spent 28µs (24+4) within Test2::Event::V2::facet_data which was called:
# once (24µs+4µs) by Test2::Hub::process at line 343 of Test2/Hub.pm | ||||
55 | 1 | 400ns | my $self = shift; | ||
56 | 1 | 1µs | my $f = { %{$self} }; | ||
57 | |||||
58 | 1 | 3µs | 1 | 1µs | delete $f->{$_} for $self->non_facet_keys; # spent 1µs making 1 call to Test2::Event::V2::non_facet_keys |
59 | |||||
60 | 1 | 200ns | my %out; | ||
61 | 1 | 1µs | for my $k (keys %$f) { | ||
62 | 4 | 2µs | next if substr($k, 0, 1) eq '_'; | ||
63 | |||||
64 | 3 | 700ns | my $data = $f->{$k} or next; # Key is there, but no facet | ||
65 | 3 | 6µs | 3 | 2µs | my $is_list = 'ARRAY' eq (reftype($data) || ''); # spent 2µs making 3 calls to Scalar::Util::reftype, avg 600ns/call |
66 | 3 | 6µs | $out{$k} = $is_list ? [ map { {%{$_}} } @$data ] : {%$data}; | ||
67 | } | ||||
68 | |||||
69 | 1 | 2µs | 1 | 1µs | if (my $meta = $self->meta_facet_data) { # spent 1µs making 1 call to Test2::Event::meta_facet_data |
70 | $out{meta} = {%$meta, %{$out{meta} || {}}}; | ||||
71 | } | ||||
72 | |||||
73 | 1 | 2µs | return \%out; | ||
74 | } | ||||
75 | |||||
76 | 1 | 2µs | 1; | ||
77 | |||||
78 | __END__ |