← 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:01:06 2013

Filename/usr/share/koha/lib/C4/ClassSortRoutine/Dewey.pm
StatementsExecuted 29 statements in 468µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11165µs10.9msC4::ClassSortRoutine::Dewey::::get_class_sort_keyC4::ClassSortRoutine::Dewey::get_class_sort_key
55157µs10.9msC4::ClassSortRoutine::Dewey::::CORE:substC4::ClassSortRoutine::Dewey::CORE:subst (opcode)
11119µs24µsC4::ClassSortRoutine::Dewey::::BEGIN@20C4::ClassSortRoutine::Dewey::BEGIN@20
11110µs23µsC4::ClassSortRoutine::Dewey::::BEGIN@21C4::ClassSortRoutine::Dewey::BEGIN@21
1119µs34µsC4::ClassSortRoutine::Dewey::::BEGIN@23C4::ClassSortRoutine::Dewey::BEGIN@23
2113µs3µsC4::ClassSortRoutine::Dewey::::CORE:matchC4::ClassSortRoutine::Dewey::CORE:match (opcode)
2112µs2µsC4::ClassSortRoutine::Dewey::::CORE:substcontC4::ClassSortRoutine::Dewey::CORE:substcont (opcode)
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package C4::ClassSortRoutine::Dewey;
2
3# Copyright (C) 2007 LibLime
4#
5# This file is part of Koha.
6#
7# Koha is free software; you can redistribute it and/or modify it under the
8# terms of the GNU General Public License as published by the Free Software
9# Foundation; either version 2 of the License, or (at your option) any later
10# version.
11#
12# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with Koha; if not, write to the Free Software Foundation, Inc.,
18# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20335µs228µs
# spent 24µs (19+4) within C4::ClassSortRoutine::Dewey::BEGIN@20 which was called: # once (19µs+4µs) by C4::ClassSource::BEGIN@25 at line 20
use strict;
# spent 24µs making 1 call to C4::ClassSortRoutine::Dewey::BEGIN@20 # spent 4µs making 1 call to strict::import
21334µs236µs
# spent 23µs (10+13) within C4::ClassSortRoutine::Dewey::BEGIN@21 which was called: # once (10µs+13µs) by C4::ClassSource::BEGIN@25 at line 21
use warnings;
# spent 23µs making 1 call to C4::ClassSortRoutine::Dewey::BEGIN@21 # spent 13µs making 1 call to warnings::import
22
233268µs259µs
# spent 34µs (9+25) within C4::ClassSortRoutine::Dewey::BEGIN@23 which was called: # once (9µs+25µs) by C4::ClassSource::BEGIN@25 at line 23
use vars qw($VERSION);
# spent 34µs making 1 call to C4::ClassSortRoutine::Dewey::BEGIN@23 # spent 25µs making 1 call to vars::import
24
25# set the version for version checking
2612µs$VERSION = 3.07.00.049;
27
28=head1 NAME
29
- -
58
# spent 10.9ms (65µs+10.9) within C4::ClassSortRoutine::Dewey::get_class_sort_key which was called: # once (65µs+10.9ms) by C4::ClassSource::BEGIN@25 at line 1 of (eval 1001)[/usr/share/koha/lib/C4/ClassSortRoutine.pm:58]
sub get_class_sort_key {
591880µs my ($cn_class, $cn_item) = @_;
60
61 $cn_class = '' unless defined $cn_class;
62 $cn_item = '' unless defined $cn_item;
63 my $init = uc "$cn_class $cn_item";
6412µs $init =~ s/^\s+//;
# spent 2µs making 1 call to C4::ClassSortRoutine::Dewey::CORE:subst
6512µs $init =~ s/\s+$//;
# spent 2µs making 1 call to C4::ClassSortRoutine::Dewey::CORE:subst
661500ns $init =~ s!/!!g;
# spent 500ns making 1 call to C4::ClassSortRoutine::Dewey::CORE:subst
67126µs410.7ms $init =~ s/^([\p{IsAlpha}]+)/$1 /;
# spent 5.34ms making 1 call to C4::ClassSortRoutine::Dewey::CORE:subst # spent 5.31ms making 1 call to utf8::SWASHNEW # spent 2µs making 2 calls to C4::ClassSortRoutine::Dewey::CORE:substcont, avg 1µs/call
68 my @tokens = split /\.|\s+/, $init;
69 my $digit_group_count = 0;
70 for (my $i = 0; $i <= $#tokens; $i++) {
7123µs if ($tokens[$i] =~ /^\d+$/) {
# spent 3µs making 2 calls to C4::ClassSortRoutine::Dewey::CORE:match, avg 1µs/call
72 $digit_group_count++;
73 if (2 == $digit_group_count) {
74 $tokens[$i] = sprintf("%-15.15s", $tokens[$i]);
75 $tokens[$i] =~ tr/ /0/;
76 }
77 }
78 }
79 # Pad the first digit_group if there was only one
80 if (1 == $digit_group_count) {
81 $tokens[0] .= '_000000000000000'
82 }
83 my $key = join("_", @tokens);
84120µs211.0ms $key =~ s/[^\p{IsAlnum}_]//g;
# spent 5.52ms making 1 call to C4::ClassSortRoutine::Dewey::CORE:subst # spent 5.49ms making 1 call to utf8::SWASHNEW
85
86 return $key;
87
88}
89
9013µs1;
91
92=head1 AUTHOR
93
- -
 
# spent 3µs within C4::ClassSortRoutine::Dewey::CORE:match which was called 2 times, avg 1µs/call: # 2 times (3µs+0s) by C4::ClassSortRoutine::Dewey::get_class_sort_key at line 71, avg 1µs/call
sub C4::ClassSortRoutine::Dewey::CORE:match; # opcode
# spent 10.9ms (57µs+10.8) within C4::ClassSortRoutine::Dewey::CORE:subst which was called 5 times, avg 2.17ms/call: # once (27µs+5.49ms) by C4::ClassSortRoutine::Dewey::get_class_sort_key at line 84 # once (24µs+5.31ms) by C4::ClassSortRoutine::Dewey::get_class_sort_key at line 67 # once (2µs+0s) by C4::ClassSortRoutine::Dewey::get_class_sort_key at line 64 # once (2µs+0s) by C4::ClassSortRoutine::Dewey::get_class_sort_key at line 65 # once (500ns+0s) by C4::ClassSortRoutine::Dewey::get_class_sort_key at line 66
sub C4::ClassSortRoutine::Dewey::CORE:subst; # opcode
# spent 2µs within C4::ClassSortRoutine::Dewey::CORE:substcont which was called 2 times, avg 1µs/call: # 2 times (2µs+0s) by C4::ClassSortRoutine::Dewey::get_class_sort_key at line 67, avg 1µs/call
sub C4::ClassSortRoutine::Dewey::CORE:substcont; # opcode