← Index
NYTProf Performance Profile   « block view • line view • sub view »
For reply.pl
  Run on Thu Oct 21 22:40:13 2010
Reported on Thu Oct 21 22:44:38 2010

Filename/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/Hailo/Role/Storage.pm
StatementsExecuted 22 statements in 390µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11143µs126µsHailo::Role::Storage::::BEGIN@9Hailo::Role::Storage::BEGIN@9
11120µs20µsHailo::Role::Storage::::BEGIN@2Hailo::Role::Storage::BEGIN@2
11113µs1.45msHailo::Role::Storage::::BEGIN@11Hailo::Role::Storage::BEGIN@11
11112µs82µsHailo::Role::Storage::::BEGIN@9.10Hailo::Role::Storage::BEGIN@9.10
11112µs399µsHailo::Role::Storage::::BEGIN@10Hailo::Role::Storage::BEGIN@10
1115µs5µsHailo::Role::Storage::::BEGIN@5Hailo::Role::Storage::BEGIN@5
0000s0sHailo::Role::Storage::::saveHailo::Role::Storage::save
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Hailo::Role::Storage;
2
# spent 20µs within Hailo::Role::Storage::BEGIN@2 which was called: # once (20µs+0s) by Mouse::Util::_try_load_one_class at line 4
BEGIN {
317µs $Hailo::Role::Storage::AUTHORITY = 'cpan:AVAR';
4124µs120µs}
# spent 20µs making 1 call to Hailo::Role::Storage::BEGIN@2
5
# spent 5µs within Hailo::Role::Storage::BEGIN@5 which was called: # once (5µs+0s) by Mouse::Util::_try_load_one_class at line 7
BEGIN {
615µs $Hailo::Role::Storage::VERSION = '0.57';
7119µs15µs}
# spent 5µs making 1 call to Hailo::Role::Storage::BEGIN@5
8
9473µs3278µs
# spent 82µs (12+70) within Hailo::Role::Storage::BEGIN@9.10 which was called: # once (12µs+70µs) by Hailo::Role::Storage::BEGIN@9 at line 9 # spent 126µs (43+82) within Hailo::Role::Storage::BEGIN@9 which was called: # once (43µs+82µs) by Mouse::Util::_try_load_one_class at line 9
use 5.010;
# spent 126µs making 1 call to Hailo::Role::Storage::BEGIN@9 # spent 82µs making 1 call to Hailo::Role::Storage::BEGIN@9.10 # spent 70µs making 1 call to feature::import
10231µs2787µs
# spent 399µs (12+387) within Hailo::Role::Storage::BEGIN@10 which was called: # once (12µs+387µs) by Mouse::Util::_try_load_one_class at line 10
use Any::Moose '::Role';
# spent 399µs making 1 call to Hailo::Role::Storage::BEGIN@10 # spent 387µs making 1 call to Any::Moose::import
112161µs22.88ms
# spent 1.45ms (13µs+1.43) within Hailo::Role::Storage::BEGIN@11 which was called: # once (13µs+1.43ms) by Mouse::Util::_try_load_one_class at line 11
use namespace::clean -except => 'meta';
# spent 1.45ms making 1 call to Hailo::Role::Storage::BEGIN@11 # spent 1.43ms making 1 call to namespace::clean::import
12
1314µs145µshas brain => (
# spent 45µs making 1 call to Mouse::Role::has
14 isa => 'Str',
15 is => 'rw',
16);
17
1814µs130µshas order => (
# spent 30µs making 1 call to Mouse::Role::has
19 isa => 'Int',
20 is => 'rw',
21);
22
2313µs132µshas hailo => (
# spent 32µs making 1 call to Mouse::Role::has
24 isa => 'HashRef',
25 is => 'ro',
26 documentation => "Miscellaneous private callbacks that Hailo provides to communicate with it",
27);
28
2913µs129µshas tokenizer_class => (
# spent 29µs making 1 call to Mouse::Role::has
30 isa => 'Str',
31 is => 'rw',
32);
33
3414µs180µsrequires 'ready';
# spent 80µs making 1 call to Mouse::Role::requires
3513µs152µsrequires 'initialized';
# spent 52µs making 1 call to Mouse::Role::requires
3613µs161µsrequires 'save';
# spent 61µs making 1 call to Mouse::Role::requires
3713µs151µsrequires 'start_learning';
# spent 51µs making 1 call to Mouse::Role::requires
3813µs154µsrequires 'stop_learning';
# spent 54µs making 1 call to Mouse::Role::requires
3913µs153µsrequires 'start_training';
# spent 53µs making 1 call to Mouse::Role::requires
4013µs153µsrequires 'stop_training';
# spent 53µs making 1 call to Mouse::Role::requires
41
42sub save {
43 # does nothing by default
44 return;
45}
46
47112µs1;
48
49=encoding utf8
50
51=head1 NAME
52
53Hailo::Role::Storage - A role representing a L<Hailo|Hailo> storage backend
54
55=head1 ATTRIBUTES
56
57=head2 C<ready>
58
59Ask the storage backend if it considers itself ready to go. E.g. a
60storage that requires a C<brain> would return false if it wasn't
61passed one.
62
63=head2 C<initialized>
64
65If you're connecting to an existing storage that already has a
66populated schema and is ready to go this'll return true.
67
68=head2 C<order>
69
70The Markov order (chain length) being used.
71
72=head2 C<brain>
73
74The name of the resource (file name, database name) to use as storage.
75
76=head1 METHODS
77
78=head2 C<new>
79
80This is the constructor. It accept the attributes specified in
81L</ATTRIBUTES>.
82
83=head2 C<save>
84
85Saves the current state.
86
87=head2 C<learn_tokens>
88
89Learns from a sequence of tokens. Takes an array reference of strings.
90
91=head2 C<make_reply>
92
93Takes an (optional) array reference of tokens and returns a reply (arrayref
94of tokens) that might be relevant.
95
96=head2 C<token_total>
97
98Takes no arguments. Returns the number of tokens the brain knows.
99
100=head2 C<expr_total>
101
102Takes no arguments. Returns the number of expressions the brain knows.
103
104=head2 C<start_learning>
105
106Takes no arguments. This method is called by L<Hailo|Hailo> right before learning
107begins.
108
109=head2 C<stop_learning>
110
111Takes no arguments. This method is called by L<Hailo|Hailo> right after learning
112finishes.
113
114=head2 C<start_training>
115
116Takes no arguments. This method is called by L<Hailo|Hailo> right before training
117begins.
118
119=head2 C<stop_training>
120
121Takes no arguments. This method is called by L<Hailo|Hailo> right after training
122finishes.
123
124=head1 AUTHOR
125
126Hinrik E<Ouml>rn SigurE<eth>sson, hinrik.sig@gmail.com
127
128=head1 LICENSE AND COPYRIGHT
129
130Copyright 2010 Hinrik E<Ouml>rn SigurE<eth>sson
131
132This program is free software, you can redistribute it and/or modify
133it under the same terms as Perl itself.
134
135122µs14.43ms=cut