Filename | /var/www/foswikidev/core/lib/Foswiki/Serialise/Simplified.pm |
Statements | Executed 14 statements in 257µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 15µs | 28µs | BEGIN@13 | Foswiki::Serialise::Simplified::
1 | 1 | 1 | 11µs | 11µs | BEGIN@15 | Foswiki::Serialise::Simplified::
1 | 1 | 1 | 10µs | 14µs | BEGIN@14 | Foswiki::Serialise::Simplified::
1 | 1 | 1 | 9µs | 9µs | new | Foswiki::Serialise::Simplified::
1 | 1 | 1 | 3µs | 3µ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 | 30µs | 2 | 41µs | # spent 28µs (15+13) within Foswiki::Serialise::Simplified::BEGIN@13 which was called:
# once (15µs+13µs) by Foswiki::Serialise::_getSerialiser at line 13 # spent 28µs making 1 call to Foswiki::Serialise::Simplified::BEGIN@13
# spent 13µs making 1 call to strict::import |
14 | 2 | 24µs | 2 | 18µs | # spent 14µs (10+4) within Foswiki::Serialise::Simplified::BEGIN@14 which was called:
# once (10µs+4µs) by Foswiki::Serialise::_getSerialiser at line 14 # spent 14µs making 1 call to Foswiki::Serialise::Simplified::BEGIN@14
# spent 4µs making 1 call to warnings::import |
15 | 2 | 182µs | 1 | 11µs | # spent 11µs within Foswiki::Serialise::Simplified::BEGIN@15 which was called:
# once (11µs+0s) by Foswiki::Serialise::_getSerialiser at line 15 # spent 11µ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 9µs within Foswiki::Serialise::Simplified::new which was called:
# once (9µs+0s) by Foswiki::Serialise::_getSerialiser at line 78 of /var/www/foswikidev/core/lib/Foswiki/Serialise.pm | ||||
24 | 1 | 500ns | my $class = shift; | ||
25 | 1 | 6µs | my $this = bless( {}, $class ); | ||
26 | 1 | 5µs | return $this; | ||
27 | } | ||||
28 | |||||
29 | # Default serialiser for QUERY | ||||
30 | # spent 3µs within Foswiki::Serialise::Simplified::write which was called:
# once (3µs+0s) by Foswiki::Serialise::serialise at line 37 of /var/www/foswikidev/core/lib/Foswiki/Serialise.pm | ||||
31 | 1 | 300ns | my $module = shift; | ||
32 | 1 | 800ns | my ($result) = @_; | ||
33 | 1 | 600ns | 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( $result, 'Perl' ); | ||||
39 | } | ||||
40 | } | ||||
41 | return join( ',', @$result ); | ||||
42 | } | ||||
43 | elsif ( ref($result) ) { | ||||
44 | return Foswiki::Serialise::serialise( $result, 'Perl' ); | ||||
45 | } | ||||
46 | else { | ||||
47 | 1 | 5µs | return defined $result ? $result : ''; | ||
48 | } | ||||
49 | } | ||||
50 | |||||
51 | sub read { | ||||
52 | my $module = shift; | ||||
53 | die 'not implemented'; | ||||
54 | } | ||||
55 | |||||
56 | 1 | 2µs | 1; | ||
57 | __END__ |