← 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 17:10:45 2013
Reported on Tue Oct 15 17:12:40 2013

Filename/usr/share/koha/lib/C4/ClassSortRoutine/Dewey.pm
StatementsExecuted 29 statements in 567µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
55186µs12.4msC4::ClassSortRoutine::Dewey::::CORE:substC4::ClassSortRoutine::Dewey::CORE:subst (opcode)
11180µs12.5msC4::ClassSortRoutine::Dewey::::get_class_sort_keyC4::ClassSortRoutine::Dewey::get_class_sort_key
11119µs24µsC4::ClassSortRoutine::Dewey::::BEGIN@20C4::ClassSortRoutine::Dewey::BEGIN@20
11117µs42µsC4::ClassSortRoutine::Dewey::::BEGIN@21C4::ClassSortRoutine::Dewey::BEGIN@21
11115µs105µsC4::ClassSortRoutine::Dewey::::BEGIN@23C4::ClassSortRoutine::Dewey::BEGIN@23
2115µs5µsC4::ClassSortRoutine::Dewey::::CORE:matchC4::ClassSortRoutine::Dewey::CORE:match (opcode)
2113µs3µ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
20346µs230µs
# spent 24µs (19+5) within C4::ClassSortRoutine::Dewey::BEGIN@20 which was called: # once (19µs+5µs) by C4::ClassSource::BEGIN@25 at line 20
use strict;
# spent 24µs making 1 call to C4::ClassSortRoutine::Dewey::BEGIN@20 # spent 5µs making 1 call to strict::import
21359µs267µs
# spent 42µs (17+25) within C4::ClassSortRoutine::Dewey::BEGIN@21 which was called: # once (17µs+25µs) by C4::ClassSource::BEGIN@25 at line 21
use warnings;
# spent 42µs making 1 call to C4::ClassSortRoutine::Dewey::BEGIN@21 # spent 25µs making 1 call to warnings::import
22
233291µs2194µs
# spent 105µs (15+89) within C4::ClassSortRoutine::Dewey::BEGIN@23 which was called: # once (15µs+89µs) by C4::ClassSource::BEGIN@25 at line 23
use vars qw($VERSION);
# spent 105µs making 1 call to C4::ClassSortRoutine::Dewey::BEGIN@23 # spent 90µ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 12.5ms (80µs+12.5) within C4::ClassSortRoutine::Dewey::get_class_sort_key which was called: # once (80µs+12.5ms) by C4::ClassSource::BEGIN@25 at line 1 of (eval 1018)[/usr/share/koha/lib/C4/ClassSortRoutine.pm:58]
sub get_class_sort_key {
5911µs my ($cn_class, $cn_item) = @_;
60
611600ns $cn_class = '' unless defined $cn_class;
621100ns $cn_item = '' unless defined $cn_item;
6312µs my $init = uc "$cn_class $cn_item";
64112µs12µs $init =~ s/^\s+//;
# spent 2µs making 1 call to C4::ClassSortRoutine::Dewey::CORE:subst
6516µs12µs $init =~ s/\s+$//;
# spent 2µs making 1 call to C4::ClassSortRoutine::Dewey::CORE:subst
6613µs1400ns $init =~ s!/!!g;
# spent 400ns making 1 call to C4::ClassSortRoutine::Dewey::CORE:subst
67147µs412.7ms $init =~ s/^([\p{IsAlpha}]+)/$1 /;
# spent 6.38ms making 1 call to C4::ClassSortRoutine::Dewey::CORE:subst # spent 6.35ms making 1 call to utf8::SWASHNEW # spent 3µs making 2 calls to C4::ClassSortRoutine::Dewey::CORE:substcont, avg 1µs/call
6818µs my @tokens = split /\.|\s+/, $init;
691900ns my $digit_group_count = 0;
7016µs for (my $i = 0; $i <= $#tokens; $i++) {
71216µs25µs if ($tokens[$i] =~ /^\d+$/) {
# spent 5µs making 2 calls to C4::ClassSortRoutine::Dewey::CORE:match, avg 3µ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 }
781600ns }
79 # Pad the first digit_group if there was only one
8011µs if (1 == $digit_group_count) {
81 $tokens[0] .= '_000000000000000'
82 }
8312µs my $key = join("_", @tokens);
84150µs212.1ms $key =~ s/[^\p{IsAlnum}_]//g;
# spent 6.06ms making 1 call to C4::ClassSortRoutine::Dewey::CORE:subst # spent 6.01ms making 1 call to utf8::SWASHNEW
85
86110µs return $key;
87
88}
89
9014µs1;
91
92=head1 AUTHOR
93
- -
 
# spent 5µs within C4::ClassSortRoutine::Dewey::CORE:match which was called 2 times, avg 3µs/call: # 2 times (5µs+0s) by C4::ClassSortRoutine::Dewey::get_class_sort_key at line 71, avg 3µs/call
sub C4::ClassSortRoutine::Dewey::CORE:match; # opcode
# spent 12.4ms (86µs+12.4) within C4::ClassSortRoutine::Dewey::CORE:subst which was called 5 times, avg 2.49ms/call: # once (31µs+6.35ms) by C4::ClassSortRoutine::Dewey::get_class_sort_key at line 67 # once (50µs+6.01ms) by C4::ClassSortRoutine::Dewey::get_class_sort_key at line 84 # 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 (400ns+0s) by C4::ClassSortRoutine::Dewey::get_class_sort_key at line 66
sub C4::ClassSortRoutine::Dewey::CORE:subst; # opcode
# spent 3µs within C4::ClassSortRoutine::Dewey::CORE:substcont which was called 2 times, avg 1µs/call: # 2 times (3µs+0s) by C4::ClassSortRoutine::Dewey::get_class_sort_key at line 67, avg 1µs/call
sub C4::ClassSortRoutine::Dewey::CORE:substcont; # opcode