← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:39:01 2010
Reported on Wed Nov 17 22:04:55 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/KiokuDB/Backend.pm
StatementsExecuted 15 statements in 2.54ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1113.81ms33.6msKiokuDB::Backend::::BEGIN@4KiokuDB::Backend::BEGIN@4
1113.78ms24.9msKiokuDB::Backend::::BEGIN@9KiokuDB::Backend::BEGIN@9
11143µs10.5msKiokuDB::Backend::::BEGIN@6KiokuDB::Backend::BEGIN@6
11143µs246µsKiokuDB::Backend::::BEGIN@7KiokuDB::Backend::BEGIN@7
0000s0sKiokuDB::Backend::::__ANON__[:19]KiokuDB::Backend::__ANON__[:19]
0000s0sKiokuDB::Backend::::__ANON__[:22]KiokuDB::Backend::__ANON__[:22]
0000s0sKiokuDB::Backend::::__ANON__[:23]KiokuDB::Backend::__ANON__[:23]
0000s0sKiokuDB::Backend::::new_from_dsnKiokuDB::Backend::new_from_dsn
0000s0sKiokuDB::Backend::::new_from_dsn_paramsKiokuDB::Backend::new_from_dsn_params
0000s0sKiokuDB::Backend::::parse_dsn_paramsKiokuDB::Backend::parse_dsn_params
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1#!/usr/bin/perl
2
3package KiokuDB::Backend;
43428µs248.8ms
# spent 33.6ms (3.81+29.8) within KiokuDB::Backend::BEGIN@4 which was called: # once (3.81ms+29.8ms) by KiokuDB::BEGIN@10 at line 4
use Moose::Role;
# spent 33.6ms making 1 call to KiokuDB::Backend::BEGIN@4 # spent 15.2ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456]
5
63148µs221.0ms
# spent 10.5ms (43µs+10.5) within KiokuDB::Backend::BEGIN@6 which was called: # once (43µs+10.5ms) by KiokuDB::BEGIN@10 at line 6
use Moose::Util::TypeConstraints;
# spent 10.5ms making 1 call to KiokuDB::Backend::BEGIN@6 # spent 10.5ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456]
73138µs2449µs
# spent 246µs (43+203) within KiokuDB::Backend::BEGIN@7 which was called: # once (43µs+203µs) by KiokuDB::BEGIN@10 at line 7
use Try::Tiny;
# spent 246µs making 1 call to KiokuDB::Backend::BEGIN@7 # spent 203µs making 1 call to Exporter::import
8
931.69ms233.0ms
# spent 24.9ms (3.78+21.2) within KiokuDB::Backend::BEGIN@9 which was called: # once (3.78ms+21.2ms) by KiokuDB::BEGIN@10 at line 9
use namespace::clean -except => 'meta';
# spent 24.9ms making 1 call to KiokuDB::Backend::BEGIN@9 # spent 8.09ms making 1 call to namespace::clean::import
10
11coerce ( __PACKAGE__,
12 from HashRef => via {
13 my %p = %$_;
14 my $class = delete $p{class} || die "Can't coerce backend from hash without a 'class' parameter";
15
16 try {
17 Class::MOP::load_class("KiokuDB::Backend::$class");
18 "KiokuDB::Backend::$class"->new(%p);
19 } catch {
20 Class::MOP::load_class($class);
21 $class->new(%p);
22 };
23 },
24141µs32.58ms);
# spent 2.56ms making 1 call to Moose::Util::TypeConstraints::coerce # spent 11µs making 1 call to Moose::Util::TypeConstraints::from # spent 10µs making 1 call to Moose::Util::TypeConstraints::via
25
26112µs11.06msrequires qw(
# spent 1.06ms making 1 call to Moose::Role::requires
27 exists
28 insert
29 get
30 delete
31);
32
33sub new_from_dsn {
34 my ( $class, $params, @extra ) = @_;
35
36 if ( defined $params ) {
37 $class->new_from_dsn_params($class->parse_dsn_params($params), @extra);
38 } else {
39 return $class->new(@extra);
40 }
41}
42
43sub new_from_dsn_params {
44 my ( $class, @params ) = @_;
45 $class->new(@params);
46}
47
48sub parse_dsn_params {
49 my ( $self, $params ) = @_;
50
51 my @pairs = split ';', $params;
52
53 return map {
54 my ( $key, $value ) = /(\w+)(?:=(.*))/;
55 length($value) ? ( $key, $value ) : ( $key => 1 );
56 } @pairs;
57}
58
59143µs__PACKAGE__
60
61140µs129.4ms__END__