Profile of lib/PONAPI/Utils/Names.pm

← Index
NYTProf Performance Profile «line view»
For script/ponapi
Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:11 2016

Filename | /home/mickey/git_tree/PONAPI/Server/lib/PONAPI/Utils/Names.pm
Statements | Executed 12 statements in 490µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 202µs | 202µs | PONAPI::Utils::Names::::BEGIN@10PONAPI::Utils::Names::BEGIN@10
1 | 1 | 1 | 15µs | 29µs | PONAPI::Utils::Names::::BEGIN@4PONAPI::Utils::Names::BEGIN@4
1 | 1 | 1 | 8µs | 29µs | PONAPI::Utils::Names::::BEGIN@7PONAPI::Utils::Names::BEGIN@7
1 | 1 | 1 | 7µs | 16µs | PONAPI::Utils::Names::::BEGIN@5PONAPI::Utils::Names::BEGIN@5
2 | 2 | 1 | 2µs | 2µs | PONAPI::Utils::Names::::CORE:qrPONAPI::Utils::Names::CORE:qr (opcode)
0 | 0 | 0 | 0s | 0s | PONAPI::Utils::Names::::check_namePONAPI::Utils::Names::check_name

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | # ABSTRACT: Member names validation utility
2 |  |  |  |  | package PONAPI::Utils::Names;
3 |  |  |  |  |
4 | 2 | 22µs | 2 | 44µs | # spent 29µs (15+14) within PONAPI::Utils::Names::BEGIN@4 which was called: # once (15µs+14µs) by PONAPI::Server::BEGIN@18 at line 4 use strict; # spent 29µs making 1 call to PONAPI::Utils::Names::BEGIN@4 # spent 14µs making 1 call to strict::import
5 | 2 | 23µs | 2 | 24µs | # spent 16µs (7+8) within PONAPI::Utils::Names::BEGIN@5 which was called: # once (7µs+8µs) by PONAPI::Server::BEGIN@18 at line 5 use warnings; # spent 16µs making 1 call to PONAPI::Utils::Names::BEGIN@5 # spent 8µs making 1 call to warnings::import
6 |  |  |  |  |
7 | 2 | 56µs | 2 | 50µs | # spent 29µs (8+21) within PONAPI::Utils::Names::BEGIN@7 which was called: # once (8µs+21µs) by PONAPI::Server::BEGIN@18 at line 7 use parent qw< Exporter >; # spent 29µs making 1 call to PONAPI::Utils::Names::BEGIN@7 # spent 21µs making 1 call to parent::import
8 | 1 | 1µs |  |  | our @EXPORT_OK = qw< check_name >;
9 |  |  |  |  |
10 | 3 | 281µs | 3 | 3.17ms | # spent 202µs within PONAPI::Utils::Names::BEGIN@10 which was called: # once (202µs+0s) by PONAPI::Server::BEGIN@18 at line 10 my $qr_edge = qr/[a-zA-Z0-9\P{ASCII}]/; # spent 2.96ms making 1 call to utf8::AUTOLOAD # spent 202µs making 1 call to PONAPI::Utils::Names::BEGIN@10 # spent 2µs making 1 call to PONAPI::Utils::Names::CORE:qr
11 | 1 | 101µs | 2 | 46µs | my $qr_mid = qr/[a-zA-Z0-9\P{ASCII}_\ -]/; # spent 46µs making 1 call to utf8::SWASHNEW # spent 600ns making 1 call to PONAPI::Utils::Names::CORE:qr
12 |  |  |  |  |
13 |  |  |  |  | sub check_name {
14 |  |  |  |  | my $name = shift;
15 |  |  |  |  |
16 |  |  |  |  | return if ref($name);
17 |  |  |  |  | return if length($name) == 0;
18 |  |  |  |  |
19 |  |  |  |  | return $name =~ /\A $qr_edge \z/x if length($name) == 1;
20 |  |  |  |  | return $name =~ /\A $qr_edge $qr_edge \z/x if length($name) == 2;
21 |  |  |  |  | return $name =~ /\A $qr_edge $qr_mid+ $qr_edge \z/x;
22 |  |  |  |  | }
23 |  |  |  |  |
24 | 1 | 5µs |  |  | 1;
25 |  |  |  |  |
26 |  |  |  |  | __END__
|  |  |  |  | # spent 2µs within PONAPI::Utils::Names::CORE:qr which was called 2 times, avg 1µs/call: # once (2µs+0s) by PONAPI::Server::BEGIN@18 at line 10 # once (600ns+0s) by PONAPI::Server::BEGIN@18 at line 11 sub PONAPI::Utils::Names::CORE:qr; # opcode