← 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
StatementsExecuted 12 statements in 490µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111202µs202µsPONAPI::Utils::Names::::BEGIN@10PONAPI::Utils::Names::BEGIN@10
11115µs29µsPONAPI::Utils::Names::::BEGIN@4PONAPI::Utils::Names::BEGIN@4
1118µs29µsPONAPI::Utils::Names::::BEGIN@7PONAPI::Utils::Names::BEGIN@7
1117µs16µsPONAPI::Utils::Names::::BEGIN@5PONAPI::Utils::Names::BEGIN@5
2212µs2µsPONAPI::Utils::Names::::CORE:qrPONAPI::Utils::Names::CORE:qr (opcode)
0000s0sPONAPI::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
2package PONAPI::Utils::Names;
3
4222µs244µ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
5223µs224µ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
7256µs250µ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
811µsour @EXPORT_OK = qw< check_name >;
9
103281µs33.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
111101µs246µsmy $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
13sub 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
2415µs1;
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