← 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/usr/share/perl/5.18/locale.pm
StatementsExecuted 17 statements in 153µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
22119µs66µslocale::::importlocale::import
11114µs25µslocale::::BEGIN@4locale::BEGIN@4
0000s0slocale::::unimportlocale::unimport
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package locale;
2
31300nsour $VERSION = '1.02';
42133µs236µs
# spent 25µs (14+11) within locale::BEGIN@4 which was called: # once (14µs+11µs) by DBD::SQLite::BEGIN@26 at line 4
use Config;
# spent 25µs making 1 call to locale::BEGIN@4 # spent 11µs making 1 call to Config::import
5
61600ns$Carp::Internal{ (__PACKAGE__) } = 1;
7
8# A separate bit is used for each of the two forms of the pragma, as they are
9# mostly independent, and interact with each other and the unicode_strings
10# feature. This allows for fast determination of which one(s) of the three
11# are to be used at any given point, and no code has to be written to deal
12# with coming in and out of scopes--it falls automatically out from the hint
13# handling
14
151100ns$locale::hint_bits = 0x4;
161100ns$locale::not_chars_hint_bits = 0x10;
17
18
# spent 66µs (19+47) within locale::import which was called 2 times, avg 33µs/call: # once (11µs+44µs) by DBD::SQLite::BEGIN@26 at line 26 of DBD/SQLite.pm # once (8µs+3µs) by DBD::SQLite::dr::BEGIN@185 at line 185 of DBD/SQLite.pm
sub import {
192200ns shift; # should be 'locale'; not checked
20
2128µs247µs if(!$Config{d_setlocale}) {
# spent 47µs making 2 calls to Config::FETCH, avg 23µs/call
22 ## No locale support found on this Perl, giving up:
23 die('Your vendor does not support locales, you cannot use the locale module.');
24 }
25
262400ns my $found_not_chars = 0;
2721µs while (defined (my $arg = shift)) {
28 if ($arg eq ":not_characters") {
29 $^H |= $locale::not_chars_hint_bits;
30
31 # This form of the pragma overrides the other
32 $^H &= ~$locale::hint_bits;
33 $found_not_chars = 1;
34 }
35 else {
36 require Carp;
37 Carp::croak("Unknown parameter '$arg' to 'use locale'");
38 }
39 }
40
41 # Use the plain form if not doing the :not_characters one.
4227µs $^H |= $locale::hint_bits unless $found_not_chars;
43}
44
45sub unimport {
46 $^H &= ~($locale::hint_bits|$locale::not_chars_hint_bits);
47}
48
4912µs1;