← Index
NYTProf Performance Profile   « block view • line view • sub view »
For ./testnewboardincnply
  Run on Mon Jan 12 21:52:27 2015
Reported on Mon Jan 12 22:01:18 2015

Filename/homes/dcw/lib/perl5/DCW/Sorthash.pm
StatementsExecuted 241 statements in 1.77ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
57211.13ms1.38msSorthash::::as_stringSorthash::as_string
5711249µs249µsSorthash::::CORE:sortSorthash::CORE:sort (opcode)
11132µs32µsSorthash::::BEGIN@8Sorthash::BEGIN@8
11126µs26µsSorthash::::newSorthash::new
11118µs21µsSorthash::::BEGIN@6Sorthash::BEGIN@6
11111µs41µsSorthash::::BEGIN@11Sorthash::BEGIN@11
1118µs41µsSorthash::::BEGIN@8.4Sorthash::BEGIN@8.4
1117µs16µsSorthash::::BEGIN@7Sorthash::BEGIN@7
0000s0sSorthash::::keysSorthash::keys
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Sorthash;
2
3# an OO perl wrapper around a hashref,
4# that sorts it's keys when printing..
5
6227µs224µs
# spent 21µs (18+3) within Sorthash::BEGIN@6 which was called: # once (18µs+3µs) by NewBoard::BEGIN@26 at line 6
use strict;
# spent 21µs making 1 call to Sorthash::BEGIN@6 # spent 3µs making 1 call to strict::import
7228µs226µs
# spent 16µs (7+9) within Sorthash::BEGIN@7 which was called: # once (7µs+9µs) by NewBoard::BEGIN@26 at line 7
use warnings;
# spent 16µs making 1 call to Sorthash::BEGIN@7 # spent 9µs making 1 call to warnings::import
84107µs3106µs
# spent 32µs within Sorthash::BEGIN@8 which was called: # once (32µs+0s) by NewBoard::BEGIN@26 at line 8 # spent 41µs (8+33) within Sorthash::BEGIN@8.4 which was called: # once (8µs+33µs) by NewBoard::BEGIN@26 at line 8
use v5.10;
# spent 41µs making 1 call to Sorthash::BEGIN@8.4 # spent 33µs making 1 call to feature::import # spent 32µs making 1 call to Sorthash::BEGIN@8
9#use Function::Parameters;
10
112226µs270µs
# spent 41µs (11+30) within Sorthash::BEGIN@11 which was called: # once (11µs+30µs) by NewBoard::BEGIN@26 at line 11
use overload '""' => \&as_string;
# spent 41µs making 1 call to Sorthash::BEGIN@11 # spent 30µs making 1 call to overload::import
12
13
14sub new
15
# spent 26µs within Sorthash::new which was called: # once (26µs+0s) by NewBoard::mkboard at line 99 of NewBoard.pm
{
16229µs my($class, %hash ) = @_;
17 return bless { %hash }, $class;
18}
19
20
21sub as_string
22
# spent 1.38ms (1.13+249µs) within Sorthash::as_string which was called 57 times, avg 24µs/call: # 56 times (1.12ms+248µs) by main::solve_game at line 33 of NewSolveGame.pm, avg 24µs/call # once (4µs+800ns) by main::solve_game at line 44 of NewSolveGame.pm
{
232281.35ms my $self = shift;
2457249µs my @k = map { "$_ -> $self->{$_}" } sort keys %$self;
# spent 249µs making 57 calls to Sorthash::CORE:sort, avg 4µs/call
25 local $" = ', ';
26 return "@k";
27};
28
29
30sub keys
31{
32 my $self = shift;
33 my @k = sort keys %$self;
34 return @k;
35};
36
37
3813µs1;
 
# spent 249µs within Sorthash::CORE:sort which was called 57 times, avg 4µs/call: # 57 times (249µs+0s) by Sorthash::as_string at line 24, avg 4µs/call
sub Sorthash::CORE:sort; # opcode