← 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:19 2015

Filename/homes/dcw/lib/perl5/DCW/Tuple.pm
StatementsExecuted 441259 statements in 423ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
10943311207ms207msTuple::::newTuple::new
10943352190ms397msTuple::::tupleTuple::tuple
1171112.74ms2.74msTuple::::detupleTuple::detuple
11123µs27µsTuple::::BEGIN@3Tuple::BEGIN@3
11112µs38µsTuple::::BEGIN@11Tuple::BEGIN@11
11111µs31µsTuple::::BEGIN@57Tuple::BEGIN@57
1119µs15µsTuple::::BEGIN@13Tuple::BEGIN@13
1118µs38µsTuple::::BEGIN@5Tuple::BEGIN@5
1118µs14µsTuple::::BEGIN@4Tuple::BEGIN@4
0000s0sTuple::::appendTuple::append
0000s0sTuple::::as_stringTuple::as_string
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Tuple;
2
3233µs231µs
# spent 27µs (23+4) within Tuple::BEGIN@3 which was called: # once (23µs+4µs) by NewBoard::BEGIN@24 at line 3
use strict;
# spent 27µs making 1 call to Tuple::BEGIN@3 # spent 4µs making 1 call to strict::import
4225µs221µs
# spent 14µs (8+6) within Tuple::BEGIN@4 which was called: # once (8µs+6µs) by NewBoard::BEGIN@24 at line 4
use warnings;
# spent 14µs making 1 call to Tuple::BEGIN@4 # spent 6µs making 1 call to warnings::import
5239µs268µs
# spent 38µs (8+30) within Tuple::BEGIN@5 which was called: # once (8µs+30µs) by NewBoard::BEGIN@24 at line 5
use Data::Dumper;
# spent 38µs making 1 call to Tuple::BEGIN@5 # spent 30µs making 1 call to Exporter::import
6
7#
8# usage: use Tuple; (mainly OO)
9# or: use Tuple qw(tuple); (convenience function too)
10
11236µs264µs
# spent 38µs (12+26) within Tuple::BEGIN@11 which was called: # once (12µs+26µs) by NewBoard::BEGIN@24 at line 11
use overload '""' => \&as_str;
# spent 38µs making 1 call to Tuple::BEGIN@11 # spent 26µs making 1 call to overload::import
12
132231µs221µs
# spent 15µs (9+6) within Tuple::BEGIN@13 which was called: # once (9µs+6µs) by NewBoard::BEGIN@24 at line 13
use Exporter 'import';
# spent 15µs making 1 call to Tuple::BEGIN@13 # spent 6µs making 1 call to Exporter::import
1411µsour @EXPORT_OK = qw(tuple);
15
16
17# exported convenience functions
18109433151ms109433207ms
# spent 397ms (190+207) within Tuple::tuple which was called 109433 times, avg 4µs/call: # 78893 times (137ms+149ms) by NewBoard::extendregion at line 287 of NewBoard.pm, avg 4µs/call # 25015 times (42.9ms+46.2ms) by NewBoard::extendregion at line 333 of NewBoard.pm, avg 4µs/call # 5515 times (10.3ms+11.5ms) by main::fulllist_all_nply at line 105 of NewIncNPlyPicker.pm, avg 4µs/call # 6 times (11µs+12µs) by main::fulllist_all_nply at line 80 of NewIncNPlyPicker.pm, avg 4µs/call # 4 times (11µs+32µs) by main::BEGIN@12 at line 261 of NewBoard.pm, avg 11µs/call
sub tuple (@) { return Tuple->new(@_); }
# spent 207ms making 109433 calls to Tuple::new, avg 2µs/call
19
20
21#
22# my $trip = Tuple->new( @elements ):
23# Construct a new Tuple with the given values.
24#
25sub new ($@)
26
# spent 207ms within Tuple::new which was called 109433 times, avg 2µs/call: # 109433 times (207ms+0s) by Tuple::tuple at line 18, avg 2µs/call
{
2710943348.8ms my( $class, @elements ) = @_;
2810943390.0ms my $tuple = bless [@elements], $class;
29109433129ms return $tuple;
30}
31
32
33#
34# my @elements = $tuple->detuple:
35# Return the array of elements from the tuple.
36#
37sub detuple ($)
38
# spent 2.74ms within Tuple::detuple which was called 1171 times, avg 2µs/call: # 1171 times (2.74ms+0s) by main::list_all_nply at line 170 of NewIncNPlyPicker.pm, avg 2µs/call
{
391171445µs my( $tuple ) = @_;
401171749µs die "Tuple->detuple: bad tuple object",Dumper($tuple),"\n"
41 unless defined $tuple && ref($tuple) eq "Tuple";
4211712.18ms return @$tuple;
43}
44
45#
46# $tuple->append( $v );
47# Append $v as an extra field in $tuple (so a 3-tuple becomes a 4-tuple)
48#
49sub append ($$)
50{
51 my( $self, $v ) = @_;
52 push @$self, $v;
53}
54
- -
57281µs250µs
# spent 31µs (11+20) within Tuple::BEGIN@57 which was called: # once (11µs+20µs) by NewBoard::BEGIN@24 at line 57
use overload '""' => \&as_string;
# spent 31µs making 1 call to Tuple::BEGIN@57 # spent 20µs making 1 call to overload::import
58
59#
60# my $str = $tuple->as_string():
61# Produce a printable string form of the given tuple.
62#
63sub as_string ($)
64{
65 my( $tuple ) = @_;
66 my $str = join(',', @$tuple);
67 return "($str)";
68}
69
70
7114µs1;