Filename | /usr/local/src/github.com/foswiki/core/lib/Foswiki/Serialise/Simplified.pm |
Statements | Executed 14 statements in 464µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 32µs | 40µs | BEGIN@13 | Foswiki::Serialise::Simplified::
1 | 1 | 1 | 25µs | 25µs | BEGIN@15 | Foswiki::Serialise::Simplified::
1 | 1 | 1 | 21µs | 42µs | BEGIN@14 | Foswiki::Serialise::Simplified::
1 | 1 | 1 | 20µs | 20µs | new | Foswiki::Serialise::Simplified::
1 | 1 | 1 | 11µs | 11µs | write | Foswiki::Serialise::Simplified::
0 | 0 | 0 | 0s | 0s | read | Foswiki::Serialise::Simplified::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | |||||
3 | =begin TML | ||||
4 | |||||
5 | ---+ package Foswiki::Serialise::Simplified | ||||
6 | |||||
7 | This is the style=perl serialiseation used by System.VarQUERY | ||||
8 | |||||
9 | =cut | ||||
10 | |||||
11 | package Foswiki::Serialise::Simplified; | ||||
12 | |||||
13 | 2 | 55µs | 2 | 49µs | # spent 40µs (32+8) within Foswiki::Serialise::Simplified::BEGIN@13 which was called:
# once (32µs+8µs) by Foswiki::Serialise::getSerialiser at line 13 # spent 40µs making 1 call to Foswiki::Serialise::Simplified::BEGIN@13
# spent 8µs making 1 call to strict::import |
14 | 2 | 51µs | 2 | 64µs | # spent 42µs (21+21) within Foswiki::Serialise::Simplified::BEGIN@14 which was called:
# once (21µs+21µs) by Foswiki::Serialise::getSerialiser at line 14 # spent 42µs making 1 call to Foswiki::Serialise::Simplified::BEGIN@14
# spent 21µs making 1 call to warnings::import |
15 | 2 | 314µs | 1 | 25µs | # spent 25µs within Foswiki::Serialise::Simplified::BEGIN@15 which was called:
# once (25µs+0s) by Foswiki::Serialise::getSerialiser at line 15 # spent 25µs making 1 call to Foswiki::Serialise::Simplified::BEGIN@15 |
16 | |||||
17 | =begin TML | ||||
18 | |||||
19 | ---++ ClassMethod new( $class, ) -> $cereal | ||||
20 | |||||
21 | =cut | ||||
22 | |||||
23 | # spent 20µs within Foswiki::Serialise::Simplified::new which was called:
# once (20µs+0s) by Foswiki::Serialise::getSerialiser at line 81 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Serialise.pm | ||||
24 | 3 | 24µs | my $class = shift; | ||
25 | my $this = bless( {}, $class ); | ||||
26 | return $this; | ||||
27 | } | ||||
28 | |||||
29 | # Default serialiser for QUERY | ||||
30 | # spent 11µs within Foswiki::Serialise::Simplified::write which was called:
# once (11µs+0s) by Foswiki::Serialise::serialise at line 39 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Serialise.pm | ||||
31 | 3 | 6µs | my $module = shift; | ||
32 | my ( $session, $result ) = @_; | ||||
33 | 1 | 10µs | if ( ref($result) eq 'ARRAY' ) { | ||
34 | |||||
35 | # If any of the results is non-scalar, have to perl it | ||||
36 | foreach my $v (@$result) { | ||||
37 | if ( ref($v) ) { | ||||
38 | return Foswiki::Serialise::serialise( $session, $result, | ||||
39 | 'Perl' ); | ||||
40 | } | ||||
41 | } | ||||
42 | return join( ',', @$result ); | ||||
43 | } | ||||
44 | elsif ( ref($result) ) { | ||||
45 | return Foswiki::Serialise::serialise( $session, $result, 'Perl' ); | ||||
46 | } | ||||
47 | else { | ||||
48 | return defined $result ? $result : ''; | ||||
49 | } | ||||
50 | } | ||||
51 | |||||
52 | sub read { | ||||
53 | my $module = shift; | ||||
54 | die 'not implemented'; | ||||
55 | } | ||||
56 | |||||
57 | 1 | 4µs | 1; | ||
58 | __END__ |