← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 11:58:52 2013
Reported on Tue Oct 15 12:02:13 2013

Filename/usr/lib/perl/5.10/Unicode/Normalize.pm
StatementsExecuted 28 statements in 779µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1319118.90ms8.90msUnicode::Normalize::::NFCUnicode::Normalize::NFC (xsub)
11180µs80µsUnicode::Normalize::::bootstrapUnicode::Normalize::bootstrap (xsub)
11131µs31µsUnicode::Normalize::::BEGIN@9Unicode::Normalize::BEGIN@9
11124µs33µsUnicode::Normalize::::BEGIN@3Unicode::Normalize::BEGIN@3
11112µs66µsUnicode::Normalize::::BEGIN@14Unicode::Normalize::BEGIN@14
11112µs60µsUnicode::Normalize::::BEGIN@12Unicode::Normalize::BEGIN@12
11110µs14µsUnicode::Normalize::::BEGIN@10Unicode::Normalize::BEGIN@10
1119µs9µsUnicode::Normalize::::CORE:packUnicode::Normalize::CORE:pack (opcode)
1119µs22µsUnicode::Normalize::::BEGIN@11Unicode::Normalize::BEGIN@11
0000s0sUnicode::Normalize::::FCDUnicode::Normalize::FCD
0000s0sUnicode::Normalize::::checkUnicode::Normalize::check
0000s0sUnicode::Normalize::::normalizeUnicode::Normalize::normalize
0000s0sUnicode::Normalize::::pack_UUnicode::Normalize::pack_U
0000s0sUnicode::Normalize::::unpack_UUnicode::Normalize::unpack_U
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Unicode::Normalize;
2
3
# spent 33µs (24+9) within Unicode::Normalize::BEGIN@3 which was called: # once (24µs+9µs) by MARC::Charset::BEGIN@10 at line 7
BEGIN {
4124µs19µs unless ("A" eq pack('U', 0x41)) {
# spent 9µs making 1 call to Unicode::Normalize::CORE:pack
5 die "Unicode::Normalize cannot stringify a Unicode code point\n";
6 }
7122µs133µs}
# spent 33µs making 1 call to Unicode::Normalize::BEGIN@3
8
9352µs131µs
# spent 31µs within Unicode::Normalize::BEGIN@9 which was called: # once (31µs+0s) by MARC::Charset::BEGIN@10 at line 9
use 5.006;
# spent 31µs making 1 call to Unicode::Normalize::BEGIN@9
10325µs218µs
# spent 14µs (10+4) within Unicode::Normalize::BEGIN@10 which was called: # once (10µs+4µs) by MARC::Charset::BEGIN@10 at line 10
use strict;
# spent 14µs making 1 call to Unicode::Normalize::BEGIN@10 # spent 4µs making 1 call to strict::import
11326µs234µs
# spent 22µs (9+13) within Unicode::Normalize::BEGIN@11 which was called: # once (9µs+13µs) by MARC::Charset::BEGIN@10 at line 11
use warnings;
# spent 22µs making 1 call to Unicode::Normalize::BEGIN@11 # spent 13µs making 1 call to warnings::import
12335µs2109µs
# spent 60µs (12+48) within Unicode::Normalize::BEGIN@12 which was called: # once (12µs+48µs) by MARC::Charset::BEGIN@10 at line 12
use Carp;
# spent 60µs making 1 call to Unicode::Normalize::BEGIN@12 # spent 48µs making 1 call to Exporter::import
13
143499µs2119µs
# spent 66µs (12+53) within Unicode::Normalize::BEGIN@14 which was called: # once (12µs+53µs) by MARC::Charset::BEGIN@10 at line 14
no warnings 'utf8';
# spent 66µs making 1 call to Unicode::Normalize::BEGIN@14 # spent 53µs making 1 call to warnings::unimport
15
161800nsour $VERSION = '1.03';
171300nsour $PACKAGE = __PACKAGE__;
18
1911µsrequire Exporter;
2011µsrequire DynaLoader;
21
22118µsour @ISA = qw(Exporter DynaLoader);
2311µsour @EXPORT = qw( NFC NFD NFKC NFKD );
2415µsour @EXPORT_OK = qw(
25 normalize decompose reorder compose
26 checkNFD checkNFKD checkNFC checkNFKC check
27 getCanon getCompat getComposite getCombinClass
28 isExclusion isSingleton isNonStDecomp isComp2nd isComp_Ex
29 isNFD_NO isNFC_NO isNFC_MAYBE isNFKD_NO isNFKC_NO isNFKC_MAYBE
30 FCD checkFCD FCC checkFCC composeContiguous
31 splitOnLastStarter
32);
33116µsour %EXPORT_TAGS = (
34 all => [ @EXPORT, @EXPORT_OK ],
35 normalize => [ @EXPORT, qw/normalize decompose reorder compose/ ],
36 check => [ qw/checkNFD checkNFKD checkNFC checkNFKC check/ ],
37 fast => [ qw/FCD checkFCD FCC checkFCC composeContiguous/ ],
38);
39
40######
41
42112µs1813µsbootstrap Unicode::Normalize $VERSION;
# spent 813µs making 1 call to DynaLoader::bootstrap
43
44######
45
46##
47## utilites for tests
48##
49
50sub pack_U {
51 return pack('U*', @_);
52}
53
54sub unpack_U {
55 return unpack('U*', shift(@_).pack('U*'));
56}
57
58
59##
60## normalization forms
61##
62
63sub FCD ($) {
64 my $str = shift;
65 return checkFCD($str) ? $str : NFD($str);
66}
67
68113µsour %formNorm = (
69 NFC => \&NFC, C => \&NFC,
70 NFD => \&NFD, D => \&NFD,
71 NFKC => \&NFKC, KC => \&NFKC,
72 NFKD => \&NFKD, KD => \&NFKD,
73 FCD => \&FCD, FCC => \&FCC,
74);
75
76sub normalize($$)
77{
78 my $form = shift;
79 my $str = shift;
80 if (exists $formNorm{$form}) {
81 return $formNorm{$form}->($str);
82 }
83 croak($PACKAGE."::normalize: invalid form name: $form");
84}
85
86
87##
88## quick check
89##
90
9115µsour %formCheck = (
92 NFC => \&checkNFC, C => \&checkNFC,
93 NFD => \&checkNFD, D => \&checkNFD,
94 NFKC => \&checkNFKC, KC => \&checkNFKC,
95 NFKD => \&checkNFKD, KD => \&checkNFKD,
96 FCD => \&checkFCD, FCC => \&checkFCC,
97);
98
99sub check($$)
100{
101 my $form = shift;
102 my $str = shift;
103 if (exists $formCheck{$form}) {
104 return $formCheck{$form}->($str);
105 }
106 croak($PACKAGE."::check: invalid form name: $form");
107}
108
109124µs1;
110__END__
 
# spent 9µs within Unicode::Normalize::CORE:pack which was called: # once (9µs+0s) by Unicode::Normalize::BEGIN@3 at line 4
sub Unicode::Normalize::CORE:pack; # opcode
# spent 8.90ms within Unicode::Normalize::NFC which was called 1319 times, avg 7µs/call: # 1319 times (8.90ms+0s) by C4::Charset::NormalizeString at line 180 of /usr/share/koha/lib/C4/Charset.pm, avg 7µs/call
sub Unicode::Normalize::NFC; # xsub
# spent 80µs within Unicode::Normalize::bootstrap which was called: # once (80µs+0s) by DynaLoader::bootstrap at line 215 of DynaLoader.pm
sub Unicode::Normalize::bootstrap; # xsub