← Index
Performance Profile   « block view • line view • sub view »
For /home/chris/git/koha.git/cataloguing/addbiblio.pl
  Run on Tue Aug 25 11:37:23 2009
Reported on Tue Aug 25 11:37:52 2009

File /usr/local/share/perl/5.10.0/CGI/Session/Serialize/yaml.pm
Statements Executed 21
Total Time 0.000817 seconds
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11133µs835µsCGI::Session::Serialize::yaml::::thawCGI::Session::Serialize::yaml::thaw
11120µs469µsCGI::Session::Serialize::yaml::::freezeCGI::Session::Serialize::yaml::freeze
LineStmts.Exclusive
Time
Avg.Code
1package CGI::Session::Serialize::yaml;
2
3241µs20µsuse strict;
# spent 15µs making 1 call to strict::import
43221µs74µsuse CGI::Session::ErrorHandler;
# spent 13µs making 1 call to UNIVERSAL::import
5
61900ns900ns$CGI::Session::Serialize::yaml::VERSION = '4.23';
718µs8µs@CGI::Session::Serialize::yaml::ISA = ( "CGI::Session::ErrorHandler" );
81200ns200nsour $Flavour;
9
1036µs2µsunless($Flavour) {
114394µs98µs my $package = (grep { eval("use $_ (); 1;") } qw(YAML::Syck YAML))[0]
12 or die "Either YAML::Syck or YAML are required to use ", __PACKAGE__;
13 $Flavour = $package;
14}
15
16
# spent 469µs (20+449) within CGI::Session::Serialize::yaml::freeze which was called # once (20µs+449µs) by CGI::Session::flush at line 249 of /usr/share/perl5/CGI/Session.pm
sub freeze {
17235µs17µs my ($self, $data) = @_;
18 return $Flavour->can('Dump')->($data);
# spent 434µs making 1 call to YAML::Syck::Dump # spent 16µs making 1 call to UNIVERSAL::can
19}
20
21
22
# spent 835µs (33+802) within CGI::Session::Serialize::yaml::thaw which was called # once (33µs+802µs) by CGI::Session::load at line 728 of /usr/share/perl5/CGI/Session.pm
sub thaw {
23232µs16µs my ($self, $string) = @_;
24168µs68µs return ($Flavour->can('Load')->($string))[0];
# spent 628µs making 1 call to YAML::Syck::Load # spent 174µs making 1 call to UNIVERSAL::can
25}
26
27111µs11µs1;
28
29__END__;
30
31=pod
32
33=head1 NAME
34
35CGI::Session::Serialize::yaml - serializer for CGI::Session
36
37=head1 DESCRIPTION
38
39This library can be used by CGI::Session to serialize session data. It uses
40C<YAML>, or the faster C implementation, C<YAML::Syck>
41if it is available. YAML serializers exist not just for Perl but also other
42dynamic languages, such as PHP, Python, and Ruby, so storing session data
43in this format makes it easy to share session data across different languages.
44
45YAML is made to be friendly for humans to parse as well as other computer
46languages. It creates a format that is easier to read than the default
47serializer.
48
49=head1 METHODS
50
51=over 4
52
53=item freeze($class, \%hash)
54
55Receives two arguments. First is the class name, the second is the data to be serialized. Should return serialized string on success, undef on failure. Error message should be set using C<set_error()|CGI::Session::ErrorHandler/"set_error()">
56
57=item thaw($class, $string)
58
59Received two arguments. First is the class name, second is the C<YAML> data string. Should return thawed data structure on success, undef on failure. Error message should be set using C<set_error()|CGI::Session::ErrorHandler/"set_error()">
60
61=back
62
63=head1 SEE ALSO
64
65C<CGI::Session>, C<YAML>, C<YAML::Syck>.
66
67=cut