Filename | /homes/dcw/lib/perl5/DCW/Tuple.pm |
Statements | Executed 441259 statements in 423ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
109433 | 1 | 1 | 207ms | 207ms | new | Tuple::
109433 | 5 | 2 | 190ms | 397ms | tuple | Tuple::
1171 | 1 | 1 | 2.74ms | 2.74ms | detuple | Tuple::
1 | 1 | 1 | 23µs | 27µs | BEGIN@3 | Tuple::
1 | 1 | 1 | 12µs | 38µs | BEGIN@11 | Tuple::
1 | 1 | 1 | 11µs | 31µs | BEGIN@57 | Tuple::
1 | 1 | 1 | 9µs | 15µs | BEGIN@13 | Tuple::
1 | 1 | 1 | 8µs | 38µs | BEGIN@5 | Tuple::
1 | 1 | 1 | 8µs | 14µs | BEGIN@4 | Tuple::
0 | 0 | 0 | 0s | 0s | append | Tuple::
0 | 0 | 0 | 0s | 0s | as_string | Tuple::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Tuple; | ||||
2 | |||||
3 | 2 | 33µs | 2 | 31µ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 # spent 27µs making 1 call to Tuple::BEGIN@3
# spent 4µs making 1 call to strict::import |
4 | 2 | 25µs | 2 | 21µ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 # spent 14µs making 1 call to Tuple::BEGIN@4
# spent 6µs making 1 call to warnings::import |
5 | 2 | 39µs | 2 | 68µ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 # 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 | |||||
11 | 2 | 36µs | 2 | 64µ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 # spent 38µs making 1 call to Tuple::BEGIN@11
# spent 26µs making 1 call to overload::import |
12 | |||||
13 | 2 | 231µs | 2 | 21µ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 # spent 15µs making 1 call to Tuple::BEGIN@13
# spent 6µs making 1 call to Exporter::import |
14 | 1 | 1µs | our @EXPORT_OK = qw(tuple); | ||
15 | |||||
16 | |||||
17 | # exported convenience functions | ||||
18 | 109433 | 151ms | 109433 | 207ms | # 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 # 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 | # | ||||
25 | sub 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 | ||||
27 | 328299 | 268ms | my( $class, @elements ) = @_; | ||
28 | my $tuple = bless [@elements], $class; | ||||
29 | return $tuple; | ||||
30 | } | ||||
31 | |||||
32 | |||||
33 | # | ||||
34 | # my @elements = $tuple->detuple: | ||||
35 | # Return the array of elements from the tuple. | ||||
36 | # | ||||
37 | sub 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 | ||||
39 | 3513 | 3.37ms | my( $tuple ) = @_; | ||
40 | die "Tuple->detuple: bad tuple object",Dumper($tuple),"\n" | ||||
41 | unless defined $tuple && ref($tuple) eq "Tuple"; | ||||
42 | 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 | # | ||||
49 | sub append ($$) | ||||
50 | { | ||||
51 | my( $self, $v ) = @_; | ||||
52 | push @$self, $v; | ||||
53 | } | ||||
54 | |||||
- - | |||||
57 | 2 | 81µs | 2 | 50µ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 # 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 | # | ||||
63 | sub as_string ($) | ||||
64 | { | ||||
65 | my( $tuple ) = @_; | ||||
66 | my $str = join(',', @$tuple); | ||||
67 | return "($str)"; | ||||
68 | } | ||||
69 | |||||
70 | |||||
71 | 1 | 4µs | 1; |