← Index
NYTProf Performance Profile   « line view »
For t/bug-md-11.t
  Run on Fri Mar 8 13:27:24 2024
Reported on Fri Mar 8 13:30:23 2024

Filename/home/micha/.plenv/versions/5.38.2/lib/perl5/site_perl/5.38.2/Test2/Event/V2.pm
StatementsExecuted 41 statements in 472µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111595µs1.71msTest2::Event::V2::::BEGIN@12Test2::Event::V2::BEGIN@12
11124µs28µsTest2::Event::V2::::facet_dataTest2::Event::V2::facet_data
11111µs12µsTest2::Event::V2::::BEGIN@2Test2::Event::V2::BEGIN@2
1117µs11µsTest2::Event::V2::::initTest2::Event::V2::init
1116µs6µsTest2::Event::V2::::BEGIN@10Test2::Event::V2::BEGIN@10
1116µs40µsTest2::Event::V2::::BEGIN@17Test2::Event::V2::BEGIN@17
1114µs21µsTest2::Event::V2::::BEGIN@7Test2::Event::V2::BEGIN@7
1114µs20µsTest2::Event::V2::::BEGIN@3Test2::Event::V2::BEGIN@3
1113µs15µsTest2::Event::V2::::BEGIN@8Test2::Event::V2::BEGIN@8
1111µs1µsTest2::Event::V2::::non_facet_keysTest2::Event::V2::non_facet_keys
0000s0sTest2::Event::V2::::set_uuidTest2::Event::V2::set_uuid
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Test2::Event::V2;
2220µs214µ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
use strict;
# spent 12µs making 1 call to Test2::Event::V2::BEGIN@2 # spent 2µs making 1 call to strict::import
3227µs237µ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
use warnings;
# spent 20µs making 1 call to Test2::Event::V2::BEGIN@3 # spent 17µs making 1 call to warnings::import
4
51300nsour $VERSION = '1.302198';
6
7216µs237µ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
use Scalar::Util qw/reftype/;
# spent 21µs making 1 call to Test2::Event::V2::BEGIN@7 # spent 17µs making 1 call to Exporter::import
8229µs227µ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
use Carp qw/croak/;
# spent 15µs making 1 call to Test2::Event::V2::BEGIN@8 # spent 12µs making 1 call to Exporter::import
9
10224µs16µ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
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
# spent 6µs making 1 call to Test2::Event::V2::BEGIN@10
11
1215µs145µ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
use Test2::Util::Facets2Legacy qw{
# 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
15182µs11.71ms};
# spent 1.71ms making 1 call to Test2::Event::V2::BEGIN@12
16
172234µs274µ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
use Test2::Util::HashBase qw/-about/;
# 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
sub non_facet_keys {
20 return (
2112µ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
sub init {
271300ns my $self = shift;
28
291400ns my $uuid;
3012µ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
4214µs10s 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
47sub 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
sub facet_data {
551400ns my $self = shift;
5611µs my $f = { %{$self} };
57
5813µs11µs delete $f->{$_} for $self->non_facet_keys;
# spent 1µs making 1 call to Test2::Event::V2::non_facet_keys
59
601200ns my %out;
6111µs for my $k (keys %$f) {
6242µs next if substr($k, 0, 1) eq '_';
63
643700ns my $data = $f->{$k} or next; # Key is there, but no facet
6536µs32µs my $is_list = 'ARRAY' eq (reftype($data) || '');
# spent 2µs making 3 calls to Scalar::Util::reftype, avg 600ns/call
6636µs $out{$k} = $is_list ? [ map { {%{$_}} } @$data ] : {%$data};
67 }
68
6912µs11µ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
7312µs return \%out;
74}
75
7612µs1;
77
78__END__