← Index
NYTProf Performance Profile   « block view • line view • sub view »
For xt/tapper-mcp-scheduler-with-db-longrun.t
  Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:22:35 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Hash/Merge/Simple.pm
StatementsExecuted 197 statements in 482µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
822198µs198µsHash::Merge::Simple::::mergeHash::Merge::Simple::merge (recurses: max depth 2, inclusive time 165µs)
1119µs9µsHash::Merge::Simple::::BEGIN@2Hash::Merge::Simple::BEGIN@2
1118µs25µsHash::Merge::Simple::::BEGIN@7Hash::Merge::Simple::BEGIN@7
1117µs10µsHash::Merge::Simple::::BEGIN@8Hash::Merge::Simple::BEGIN@8
1117µs42µsHash::Merge::Simple::::BEGIN@10Hash::Merge::Simple::BEGIN@10
0000s0sHash::Merge::Simple::::clone_mergeHash::Merge::Simple::clone_merge
0000s0sHash::Merge::Simple::::dclone_mergeHash::Merge::Simple::dclone_merge
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Hash::Merge::Simple;
2
# spent 9µs within Hash::Merge::Simple::BEGIN@2 which was called: # once (9µs+0s) by Tapper::Config::BEGIN@18 at line 4
BEGIN {
318µs $Hash::Merge::Simple::VERSION = '0.051';
4114µs19µs}
# spent 9µs making 1 call to Hash::Merge::Simple::BEGIN@2
5# ABSTRACT: Recursively merge two or more hashes, simply
6
7319µs241µs
# spent 25µs (8+16) within Hash::Merge::Simple::BEGIN@7 which was called: # once (8µs+16µs) by Tapper::Config::BEGIN@18 at line 7
use warnings;
# spent 25µs making 1 call to Hash::Merge::Simple::BEGIN@7 # spent 16µs making 1 call to warnings::import
8320µs213µs
# spent 10µs (7+3) within Hash::Merge::Simple::BEGIN@8 which was called: # once (7µs+3µs) by Tapper::Config::BEGIN@18 at line 8
use strict;
# spent 10µs making 1 call to Hash::Merge::Simple::BEGIN@8 # spent 3µs making 1 call to strict::import
9
103211µs276µs
# spent 42µs (7+34) within Hash::Merge::Simple::BEGIN@10 which was called: # once (7µs+34µs) by Tapper::Config::BEGIN@18 at line 10
use vars qw/ @ISA @EXPORT_OK /;
# spent 42µs making 1 call to Hash::Merge::Simple::BEGIN@10 # spent 34µs making 1 call to vars::import
111700nsrequire Exporter;
1217µs@ISA = qw/ Exporter /;
1311µs@EXPORT_OK = qw/ merge clone_merge dclone_merge /;
14
15
16# This was stoled from Catalyst::Utils... thanks guys!
17sub merge (@);
18
# spent 198µs (198+-0ns) within Hash::Merge::Simple::merge which was called 8 times, avg 25µs/call: # 7 times (127µs+-127µs) by Hash::Merge::Simple::merge at line 34, avg 0s/call # once (71µs+127µs) by Tapper::Config::_switch_context at line 75 of Tapper/Config.pm
sub merge (@) {
19183199µs shift unless ref $_[0]; # Take care of the case we're called like Hash::Merge::Simple->merge(...)
20 my ($left, @right) = @_;
21
22 return $left unless @right;
23
24 return merge($left, merge(@right)) if @right > 1;
25
26 my ($right) = @right;
27
28 my %merge = %$left;
29
30 for my $key (keys %$right) {
31
32 my ($hr, $hl) = map { ref $_->{$key} eq 'HASH' } $right, $left;
33
3470s if ($hr and $hl){
# spent 165µs making 7 calls to Hash::Merge::Simple::merge, avg 24µs/call, recursion: max depth 2, sum of overlapping time 165µs
35 $merge{$key} = merge($left->{$key}, $right->{$key});
36 }
37 else {
38 $merge{$key} = $right->{$key};
39 }
40 }
41
42 return \%merge;
43}
44
45
46sub clone_merge {
47 require Clone;
48 my $result = merge @_;
49 return Clone::clone( $result );
50}
51
52
53sub dclone_merge {
54 require Storable;
55 my $result = merge @_;
56 return Storable::dclone( $result );
57}
58
59
6014µs1;
61
62__END__