← Index
NYTProf Performance Profile   « line view »
For svc/members/upsert
  Run on Tue Jan 13 11:50:22 2015
Reported on Tue Jan 13 12:09:49 2015

Filename/mnt/catalyst/koha/C4/ClassSortRoutine/Generic.pm
StatementsExecuted 17 statements in 340µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111739µs752µsC4::ClassSortRoutine::Generic::::BEGIN@20C4::ClassSortRoutine::Generic::BEGIN@20
11115µs20µsC4::ClassSortRoutine::Generic::::get_class_sort_keyC4::ClassSortRoutine::Generic::get_class_sort_key
1118µs14µsC4::ClassSortRoutine::Generic::::BEGIN@21C4::ClassSortRoutine::Generic::BEGIN@21
1117µs26µsC4::ClassSortRoutine::Generic::::BEGIN@23C4::ClassSortRoutine::Generic::BEGIN@23
4415µs5µsC4::ClassSortRoutine::Generic::::CORE:substC4::ClassSortRoutine::Generic::CORE:subst (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::Generic;
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
20230µs2766µs
# spent 752µs (739+14) within C4::ClassSortRoutine::Generic::BEGIN@20 which was called: # once (739µs+14µs) by C4::ClassSource::BEGIN@25 at line 20
use strict;
# spent 752µs making 1 call to C4::ClassSortRoutine::Generic::BEGIN@20 # spent 14µs making 1 call to strict::import
21225µs219µs
# spent 14µs (8+5) within C4::ClassSortRoutine::Generic::BEGIN@21 which was called: # once (8µs+5µs) by C4::ClassSource::BEGIN@25 at line 21
use warnings;
# spent 14µs making 1 call to C4::ClassSortRoutine::Generic::BEGIN@21 # spent 5µs making 1 call to warnings::import
22
23296µs245µs
# spent 26µs (7+19) within C4::ClassSortRoutine::Generic::BEGIN@23 which was called: # once (7µs+19µs) by C4::ClassSource::BEGIN@25 at line 23
use vars qw($VERSION);
# spent 26µs making 1 call to C4::ClassSortRoutine::Generic::BEGIN@23 # spent 19µs making 1 call to vars::import
24
25# set the version for version checking
2611µs$VERSION = 3.07.00.049;
27
28=head1 NAME
29
30C4::ClassSortRoutine::Generic - generic call number sorting key routine
31
32=head1 SYNOPSIS
33
34use C4::ClassSortRoutine;
35
36my $cn_sort = GetClassSortKey('Generic', $cn_class, $cn_item);
37
38=head1 FUNCTIONS
39
40=head2 get_class_sort_key
41
42 my $cn_sort = C4::ClassSortRoutine::Generic::Generic($cn_class, $cn_item);
43
44Generates sorting key using the following rules:
45
46* Concatenates class and item part.
47* Removes leading and trailing whitespace.
48* Converts each run of whitespace to an underscore.
49* Converts to upper-case and removes non-alphabetical, non-numeric, non-underscore characters.
50
51=cut
52
53
# spent 20µs (15+5) within C4::ClassSortRoutine::Generic::get_class_sort_key which was called: # once (15µs+5µs) by C4::ClassSource::BEGIN@25 at line 1 of (eval 43)[C4/ClassSortRoutine.pm:58]
sub get_class_sort_key {
541600ns my ($cn_class, $cn_item) = @_;
55
561200ns $cn_class = '' unless defined $cn_class;
571100ns $cn_item = '' unless defined $cn_item;
581800ns my $key = uc "$cn_class $cn_item";
5916µs12µs $key =~ s/^\s+//;
# spent 2µs making 1 call to C4::ClassSortRoutine::Generic::CORE:subst
6014µs11µs $key =~ s/\s+$//;
# spent 1µs making 1 call to C4::ClassSortRoutine::Generic::CORE:subst
6114µs12µs $key =~ s/\s+/_/g;
# spent 2µs making 1 call to C4::ClassSortRoutine::Generic::CORE:subst
621165µs256µs $key =~ s/[^\p{IsAlnum}_]//g;
# spent 55µs making 1 call to utf8::SWASHNEW # spent 500ns making 1 call to C4::ClassSortRoutine::Generic::CORE:subst
6314µs return $key;
64
65}
66
6713µs1;
68
69=head1 AUTHOR
70
71Koha Development Team <http://koha-community.org/>
72
73=cut
74
 
# spent 5µs within C4::ClassSortRoutine::Generic::CORE:subst which was called 4 times, avg 1µs/call: # once (2µs+0s) by C4::ClassSortRoutine::Generic::get_class_sort_key at line 61 # once (2µs+0s) by C4::ClassSortRoutine::Generic::get_class_sort_key at line 59 # once (1µs+0s) by C4::ClassSortRoutine::Generic::get_class_sort_key at line 60 # once (500ns+0s) by C4::ClassSortRoutine::Generic::get_class_sort_key at line 62
sub C4::ClassSortRoutine::Generic::CORE:subst; # opcode