Filename | /Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/MooseX/Storage/IO/StorableFile.pm |
Statements | Executed 12 statements in 320µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 1.86ms | 2.29ms | BEGIN@10 | MooseX::Storage::IO::StorableFile::
1 | 1 | 1 | 9µs | 9µs | BEGIN@5 | MooseX::Storage::IO::StorableFile::
1 | 1 | 1 | 8µs | 83µs | BEGIN@33 | MooseX::Storage::IO::StorableFile::
1 | 1 | 1 | 6µs | 1.86ms | BEGIN@8 | MooseX::Storage::IO::StorableFile::
0 | 0 | 0 | 0s | 0s | load | MooseX::Storage::IO::StorableFile::
0 | 0 | 0 | 0s | 0s | store | MooseX::Storage::IO::StorableFile::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package MooseX::Storage::IO::StorableFile; | ||||
2 | { | ||||
3 | 2 | 700ns | $MooseX::Storage::IO::StorableFile::VERSION = '0.39'; | ||
4 | } | ||||
5 | # spent 9µs within MooseX::Storage::IO::StorableFile::BEGIN@5 which was called:
# once (9µs+0s) by Module::Runtime::require_module at line 7 | ||||
6 | 1 | 4µs | $MooseX::Storage::IO::StorableFile::AUTHORITY = 'cpan:STEVAN'; | ||
7 | 1 | 17µs | 1 | 9µs | } # spent 9µs making 1 call to MooseX::Storage::IO::StorableFile::BEGIN@5 |
8 | 2 | 29µs | 2 | 3.71ms | # spent 1.86ms (6µs+1.85) within MooseX::Storage::IO::StorableFile::BEGIN@8 which was called:
# once (6µs+1.85ms) by Module::Runtime::require_module at line 8 # spent 1.86ms making 1 call to MooseX::Storage::IO::StorableFile::BEGIN@8
# spent 1.85ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:519] |
9 | |||||
10 | 2 | 231µs | 1 | 2.29ms | # spent 2.29ms (1.86+432µs) within MooseX::Storage::IO::StorableFile::BEGIN@10 which was called:
# once (1.86ms+432µs) by Module::Runtime::require_module at line 10 # spent 2.29ms making 1 call to MooseX::Storage::IO::StorableFile::BEGIN@10 |
11 | |||||
12 | 1 | 1µs | 1 | 100µs | requires 'pack'; # spent 100µs making 1 call to Moose::Role::requires |
13 | 1 | 900ns | 1 | 35µs | requires 'unpack'; # spent 35µs making 1 call to Moose::Role::requires |
14 | |||||
15 | sub load { | ||||
16 | my ( $class, $filename, @args ) = @_; | ||||
17 | # try thawing | ||||
18 | return $class->thaw( Storable::retrieve($filename), @args ) | ||||
19 | if $class->can('thaw'); | ||||
20 | # otherwise just unpack | ||||
21 | $class->unpack( Storable::retrieve($filename), @args ); | ||||
22 | } | ||||
23 | |||||
24 | sub store { | ||||
25 | my ( $self, $filename, @args ) = @_; | ||||
26 | Storable::nstore( | ||||
27 | # try freezing, otherwise just pack | ||||
28 | ($self->can('freeze') ? $self->freeze(@args) : $self->pack(@args)), | ||||
29 | $filename | ||||
30 | ); | ||||
31 | } | ||||
32 | |||||
33 | 2 | 30µs | 2 | 158µs | # spent 83µs (8+75) within MooseX::Storage::IO::StorableFile::BEGIN@33 which was called:
# once (8µs+75µs) by Module::Runtime::require_module at line 33 # spent 83µs making 1 call to MooseX::Storage::IO::StorableFile::BEGIN@33
# spent 75µs making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:706] |
34 | |||||
35 | 1 | 6µs | 1; | ||
36 | |||||
37 | __END__ |