Filename | /usr/local/lib/perl5/site_perl/Locale/gettext_dumb.pm |
Statements | Executed 358110 statements in 616ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
35811 | 2 | 1 | 301ms | 2.40s | dcnpgettext | Locale::gettext_dumb::
34661 | 1 | 1 | 167ms | 2.47s | gettext | Locale::gettext_dumb::
35811 | 1 | 1 | 140ms | 153ms | __get_locale | Locale::gettext_dumb::
35811 | 1 | 1 | 12.2ms | 12.2ms | CORE:subst (opcode) | Locale::gettext_dumb::
1150 | 1 | 1 | 9.23ms | 110ms | dgettext | Locale::gettext_dumb::
0 | 0 | 0 | 0s | 0s | BEGIN@24 | Locale::gettext_dumb::
0 | 0 | 0 | 0s | 0s | BEGIN@26 | Locale::gettext_dumb::
0 | 0 | 0 | 0s | 0s | dcgettext | Locale::gettext_dumb::
0 | 0 | 0 | 0s | 0s | dcngettext | Locale::gettext_dumb::
0 | 0 | 0 | 0s | 0s | dcpgettext | Locale::gettext_dumb::
0 | 0 | 0 | 0s | 0s | dngettext | Locale::gettext_dumb::
0 | 0 | 0 | 0s | 0s | dnpgettext | Locale::gettext_dumb::
0 | 0 | 0 | 0s | 0s | dpgettext | Locale::gettext_dumb::
0 | 0 | 0 | 0s | 0s | ngettext | Locale::gettext_dumb::
0 | 0 | 0 | 0s | 0s | npgettext | Locale::gettext_dumb::
0 | 0 | 0 | 0s | 0s | pgettext | Locale::gettext_dumb::
0 | 0 | 0 | 0s | 0s | setlocale | Locale::gettext_dumb::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | #! /bin/false | ||||
2 | |||||
3 | # vim: set autoindent shiftwidth=4 tabstop=4: | ||||
4 | |||||
5 | # Pure Perl implementation of Uniforum message translation. | ||||
6 | # Copyright (C) 2002-2017 Guido Flohr <guido.flohr@cantanea.com>, | ||||
7 | # all rights reserved. | ||||
8 | |||||
9 | # This program is free software: you can redistribute it and/or modify | ||||
10 | # it under the terms of the GNU General Public License as published by | ||||
11 | # the Free Software Foundation; either version 3 of the License, or | ||||
12 | # (at your option) any later version. | ||||
13 | |||||
14 | # This program is distributed in the hope that it will be useful, | ||||
15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
17 | # GNU General Public License for more details. | ||||
18 | |||||
19 | # You should have received a copy of the GNU General Public License | ||||
20 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
21 | |||||
22 | package Locale::gettext_dumb; | ||||
23 | |||||
24 | use Locale::gettext_pp; | ||||
25 | |||||
26 | use vars qw (%EXPORT_TAGS @EXPORT_OK @ISA $VERSION); | ||||
27 | |||||
28 | %EXPORT_TAGS = (locale_h => [ qw (gettext | ||||
29 | dgettext | ||||
30 | dcgettext | ||||
31 | ngettext | ||||
32 | dngettext | ||||
33 | dcngettext | ||||
34 | pgettext | ||||
35 | dpgettext | ||||
36 | dcpgettext | ||||
37 | npgettext | ||||
38 | dnpgettext | ||||
39 | dcnpgettext | ||||
40 | textdomain | ||||
41 | bindtextdomain | ||||
42 | bind_textdomain_codeset | ||||
43 | )], | ||||
44 | libintl_h => [ qw (LC_CTYPE | ||||
45 | LC_NUMERIC | ||||
46 | LC_TIME | ||||
47 | LC_COLLATE | ||||
48 | LC_MONETARY | ||||
49 | LC_MESSAGES | ||||
50 | LC_ALL)], | ||||
51 | ); | ||||
52 | |||||
53 | @EXPORT_OK = qw (gettext | ||||
54 | dgettext | ||||
55 | dcgettext | ||||
56 | ngettext | ||||
57 | dngettext | ||||
58 | dcngettext | ||||
59 | pgettext | ||||
60 | dpgettext | ||||
61 | dcpgettext | ||||
62 | npgettext | ||||
63 | dnpgettext | ||||
64 | dcnpgettext | ||||
65 | textdomain | ||||
66 | bindtextdomain | ||||
67 | bind_textdomain_codeset | ||||
68 | nl_putenv | ||||
69 | setlocale | ||||
70 | LC_CTYPE | ||||
71 | LC_NUMERIC | ||||
72 | LC_TIME | ||||
73 | LC_COLLATE | ||||
74 | LC_MONETARY | ||||
75 | LC_MESSAGES | ||||
76 | LC_ALL); | ||||
77 | |||||
78 | @ISA = qw (Exporter); | ||||
79 | |||||
80 | *Locale::gettext_dumb::textdomain = \&Locale::gettext_pp::textdomain; | ||||
81 | *Locale::gettext_dumb::bindtextdomain = \&Locale::gettext_pp::bindtextdomain; | ||||
82 | *Locale::gettext_dumb::bind_textdomain_codeset = | ||||
83 | \&Locale::gettext_pp::bind_textdomain_codeset; | ||||
84 | |||||
85 | *Locale::gettext_dumb::nl_putenv = \&Locale::gettext_pp::nl_putenv; | ||||
86 | |||||
87 | *Locale::gettext_dumb::LC_CTYPE = \&Locale::gettext_pp::LC_CTYPE; | ||||
88 | *Locale::gettext_dumb::LC_NUMERIC = \&Locale::gettext_pp::LC_NUMERIC; | ||||
89 | *Locale::gettext_dumb::LC_TIME= \&Locale::gettext_pp::LC_TIME; | ||||
90 | *Locale::gettext_dumb::LC_COLLATE = \&Locale::gettext_pp::LC_COLLATE; | ||||
91 | *Locale::gettext_dumb::LC_MONETARY = \&Locale::gettext_pp::LC_MONETARY; | ||||
92 | *Locale::gettext_dumb::LC_MESSAGES = \&Locale::gettext_pp::LC_MESSAGES; | ||||
93 | *Locale::gettext_dumb::LC_ALL = \&Locale::gettext_pp::LC_ALL; | ||||
94 | |||||
95 | |||||
96 | # spent 2.47s (167ms+2.30) within Locale::gettext_dumb::gettext which was called 34661 times, avg 71µs/call:
# 34661 times (167ms+2.30s) by Locale::Messages::gettext at line 254 of Locale/Messages.pm, avg 71µs/call | ||||
97 | 34661 | 10.2ms | my ($msgid) = @_; | ||
98 | |||||
99 | 34661 | 122ms | 34661 | 2.30s | return dcnpgettext ('', undef, $msgid, undef, undef, undef); # spent 2.30s making 34661 calls to Locale::gettext_dumb::dcnpgettext, avg 66µs/call |
100 | } | ||||
101 | |||||
102 | # spent 110ms (9.23+101) within Locale::gettext_dumb::dgettext which was called 1150 times, avg 95µs/call:
# 1150 times (9.23ms+101ms) by Locale::Messages::dgettext at line 263 of Locale/Messages.pm, avg 95µs/call | ||||
103 | 1150 | 654µs | my ($domainname, $msgid) = @_; | ||
104 | |||||
105 | 1150 | 2.95ms | 1150 | 101ms | return dcnpgettext ($domainname, undef, $msgid, undef, undef, undef); # spent 101ms making 1150 calls to Locale::gettext_dumb::dcnpgettext, avg 87µs/call |
106 | } | ||||
107 | |||||
108 | sub dcgettext ($$$) { | ||||
109 | my ($domainname, $msgid, $category) = @_; | ||||
110 | |||||
111 | return dcnpgettext ($domainname, undef, $msgid, undef, undef, undef); | ||||
112 | } | ||||
113 | |||||
114 | sub ngettext ($$$) { | ||||
115 | my ($msgid, $msgid_plural, $n) = @_; | ||||
116 | |||||
117 | return dcnpgettext ('', undef, $msgid, $msgid_plural, $n, undef); | ||||
118 | } | ||||
119 | |||||
120 | sub dngettext ($$$$) { | ||||
121 | my ($domainname, $msgid, $msgid_plural, $n) = @_; | ||||
122 | |||||
123 | return dcnpgettext ($domainname, undef, $msgid, $msgid_plural, $n, undef); | ||||
124 | } | ||||
125 | |||||
126 | sub dcngettext ($$$$$) { | ||||
127 | my ($domainname, $msgid, $msgid_plural, $n, $category) = @_; | ||||
128 | |||||
129 | return dcnpgettext ($domainname, undef, $msgid, $msgid_plural, $n, , | ||||
130 | $category); | ||||
131 | } | ||||
132 | |||||
133 | sub pgettext ($$) { | ||||
134 | my ($msgctxt, $msgid) = @_; | ||||
135 | |||||
136 | return dcnpgettext ('', $msgctxt, $msgid, undef, undef, undef); | ||||
137 | } | ||||
138 | |||||
139 | sub dpgettext ($$$) { | ||||
140 | my ($domainname, $msgctxt, $msgid) = @_; | ||||
141 | |||||
142 | return dcnpgettext ($domainname, $msgctxt, $msgid, undef, undef, undef); | ||||
143 | } | ||||
144 | |||||
145 | sub dcpgettext($$$$) { | ||||
146 | my ($domainname, $msgctxt, $msgid, $category) = @_; | ||||
147 | |||||
148 | return dcnpgettext ($domainname, $msgctxt, $msgid, undef, undef, undef); | ||||
149 | } | ||||
150 | |||||
151 | sub npgettext ($$$$) { | ||||
152 | my ($msgctxt, $msgid, $msgid_plural, $n) = @_; | ||||
153 | |||||
154 | return dcnpgettext ('', $msgctxt, $msgid, $msgid_plural, $n, undef); | ||||
155 | } | ||||
156 | |||||
157 | sub dnpgettext ($$$$$) { | ||||
158 | my ($domainname, $msgctxt, $msgid, $msgid_plural, $n) = @_; | ||||
159 | |||||
160 | return dcnpgettext ($domainname, $msgctxt, $msgid, $msgid_plural, $n, undef); | ||||
161 | } | ||||
162 | |||||
163 | # spent 153ms (140+12.2) within Locale::gettext_dumb::__get_locale which was called 35811 times, avg 4µs/call:
# 35811 times (140ms+12.2ms) by Locale::gettext_dumb::dcnpgettext at line 185, avg 4µs/call | ||||
164 | 35811 | 4.70ms | my $locale; | ||
165 | |||||
166 | 35811 | 19.9ms | if (exists $ENV{LANGUAGE} && length $ENV{LANGUAGE}) { | ||
167 | 35811 | 11.4ms | $locale = $ENV{LANGUAGE}; | ||
168 | 35811 | 91.3ms | 35811 | 12.2ms | $locale =~ s/:.*//s; # spent 12.2ms making 35811 calls to Locale::gettext_dumb::CORE:subst, avg 340ns/call |
169 | } elsif (exists $ENV{LC_ALL} && length $ENV{LC_ALL}) { | ||||
170 | $locale = $ENV{LC_ALL}; | ||||
171 | } elsif (exists $ENV{LANG} && length $ENV{LANG}) { | ||||
172 | $locale = $ENV{LANG}; | ||||
173 | } elsif (exists $ENV{LC_MESSAGES} && length $ENV{LC_MESSAGES}) { | ||||
174 | $locale = $ENV{LC_MESSAGES}; | ||||
175 | } else { | ||||
176 | $locale = 'C'; | ||||
177 | } | ||||
178 | |||||
179 | 35811 | 147ms | return $locale; | ||
180 | } | ||||
181 | |||||
182 | sub dcnpgettext ($$$$$$) { | ||||
183 | 35811 | 17.2ms | my ($domainname, $msgctxt, $msgid, $msgid_plural, $n, $category) = @_; | ||
184 | |||||
185 | 35811 | 36.4ms | 35811 | 153ms | my $locale = __get_locale; # spent 153ms making 35811 calls to Locale::gettext_dumb::__get_locale, avg 4µs/call |
186 | |||||
187 | 35811 | 152ms | 35811 | 1.95s | return Locale::gettext_pp::_dcnpgettext_impl ($domainname, $msgctxt, # spent 1.95s making 35811 calls to Locale::gettext_pp::_dcnpgettext_impl, avg 54µs/call |
188 | $msgid, $msgid_plural, $n, | ||||
189 | $category, $locale); | ||||
190 | } | ||||
191 | |||||
192 | sub setlocale($;$) { | ||||
193 | &POSIX::setlocale; | ||||
194 | } | ||||
195 | |||||
196 | 1; | ||||
197 | |||||
198 | __END__ | ||||
# spent 12.2ms within Locale::gettext_dumb::CORE:subst which was called 35811 times, avg 340ns/call:
# 35811 times (12.2ms+0s) by Locale::gettext_dumb::__get_locale at line 168, avg 340ns/call |