WordPressが遅い。初心に戻って検証してみる。その6- load_default_textdomain
前述までのWordPressインストール直後のHelloWorldページプロファイリング、470,612micro second を要した load_default_textdomainを調査。
だんだん処理に時間を要している箇所が絞れてきた。
MO::import_from_file
がかなりの処理をやっている。
MO::make_entry
POMO_Reader::substr
Translation_Entry::key
はexplode
、chr
、substr
、is_null
などのPHPの関数を呼んでいる。
これ以上は追えない。
load_default_textdomain
load_textdomain
MO::import_from_file
MO::import_from_reader
MO::make_entry
POMO_Reader::substr
Translation_Entry::key
このあたりの関数は何をやっているのだろうか。
load_textdomain
MO::import\_from\_file
MO::import\_from\_reader
次はこのあたりの処理を調べたい。
load_default_textdomain
Function Name |
Calls |
Calls% |
Incl. Wall Time(microsec) |
IWall% |
Current Function |
|
|
|
|
load_default_textdomain |
1 |
7.70% |
470,612 |
36.70% |
Exclusive Metrics for Current Function |
|
|
74 |
0.00% |
Parent function |
|
|
|
|
run_init::wordpress/wp-settings.php |
1 |
100.00% |
470,612 |
100.00% |
Child functions |
|
|
|
|
load_textdomain |
1 |
12.50% |
470,292 |
99.90% |
get_locale |
1 |
12.50% |
84 |
0.00% |
is_admin |
1 |
12.50% |
77 |
0.00% |
is_multisite |
1 |
12.50% |
32 |
0.00% |
defined |
3 |
37.50% |
30 |
0.00% |
is_network_admin |
1 |
12.50% |
23 |
0.00% |
Function Name |
Calls |
Calls% |
Incl. Wall Time(microsec) |
IWall% |
load_textdomain |
2 |
11.80% |
511,996 |
40.00% |
Exclusive Metrics for Current Function |
|
|
183 |
0.00% |
Parent functions |
|
|
|
|
load_default_textdomain |
1 |
50.00% |
470,292 |
91.90% |
load_theme_textdomain |
1 |
50.00% |
41,704 |
8.10% |
Child functions |
|
|
|
|
MO::import_from_file |
2 |
18.20% |
511,585 |
99.90% |
is_readable |
2 |
18.20% |
86 |
0.00% |
apply_filters |
4 |
36.40% |
61 |
0.00% |
Translations::merge_with |
1 |
9.10% |
37 |
0.00% |
do_action@1 |
1 |
9.10% |
23 |
0.00% |
do_action |
1 |
9.10% |
21 |
0.00% |
Function Name |
Calls |
Calls% |
Incl. Wall Time(microsec) |
IWall% |
Current Function |
|
|
|
|
MO::import_from_file |
2 |
16.70% |
511,585 |
39.90% |
Exclusive Metrics for Current Function |
|
|
1,020 |
0.20% |
Parent function |
|
|
|
|
load_textdomain |
2 |
100.00% |
511,585 |
100.00% |
Child functions |
|
|
|
|
MO::import_from_reader |
2 |
33.30% |
510,186 |
99.70% |
POMO_FileReader::POMO_FileReader |
2 |
33.30% |
317 |
0.10% |
POMO_FileReader::is_resource |
2 |
33.30% |
62 |
0.00% |
Function Name |
Calls |
Calls% |
Incl. Wall Time(microsec) |
IWall% |
Current Function |
|
|
|
|
MO::import_from_reader |
2 |
0.00% |
510,186 |
39.80% |
Exclusive Metrics for Current Function |
|
|
99,840 |
19.60% |
Parent function |
|
|
|
|
MO::import_from_file |
2 |
100.00% |
510,186 |
100.00% |
Child functions |
|
|
|
|
MO::make_entry |
1,758 |
16.60% |
210,334 |
41.20% |
POMO_Reader::substr |
3,520 |
33.20% |
85,249 |
16.70% |
Translation_Entry::key |
1,758 |
16.60% |
64,243 |
12.60% |
unpack |
3,522 |
33.20% |
42,340 |
8.30% |
POMO_FileReader::read_all |
2 |
0.00% |
2,662 |
0.50% |
POMO_Reader::str_split |
4 |
0.00% |
2,093 |
0.40% |
Translations::set_headers |
2 |
0.00% |
1,561 |
0.30% |
Gettext_Translations::make_headers |
2 |
0.00% |
840 |
0.20% |
POMO_Reader::readint32 |
2 |
0.00% |
283 |
0.10% |
POMO_FileReader::read |
6 |
0.10% |
246 |
0.00% |
POMO_FileReader::seekto |
4 |
0.00% |
167 |
0.00% |
POMO_Reader::strlen |
6 |
0.10% |
130 |
0.00% |
POMO_FileReader::close |
2 |
0.00% |
80 |
0.00% |
extract |
2 |
0.00% |
52 |
0.00% |
MO::get_byteorder |
2 |
0.00% |
29 |
0.00% |
POMO_Reader::setEndian |
2 |
0.00% |
23 |
0.00% |
is_array |
2 |
0.00% |
14 |
0.00% |
Function Name |
Calls |
Calls% |
Incl. Wall Time(microsec) |
IWall% |
Current Function |
|
|
|
|
MO::make_entry |
1,758 |
12.50% |
210,334 |
16.40% |
Exclusive Metrics for Current Function |
|
|
103,885 |
49.40% |
Parent function |
|
|
|
|
MO::import_from_reader |
1,758 |
100.00% |
210,334 |
100.00% |
Child functions |
|
|
|
|
explode |
5,274 |
42.90% |
46,754 |
22.20% |
chr |
5,274 |
42.90% |
37,997 |
18.10% |
Translation_Entry::Translation_Entry |
1,758 |
14.30% |
21,698 |
10.30% |
Function Name |
Calls |
Calls% |
Incl. Wall Time(microsec) |
IWall% |
Current Function |
|
|
|
|
POMO_Reader::substr |
3,520 |
50.00% |
85,249 |
6.70% |
Exclusive Metrics for Current Function |
|
|
57,741 |
67.70% |
Parent function |
|
|
|
|
MO::import_from_reader |
3,520 |
100.00% |
85,249 |
100.00% |
Child function |
|
|
|
|
substr |
3,520 |
100.00% |
27,508 |
32.30% |
Function Name |
Calls |
Calls% |
Incl. Wall Time(microsec) |
IWall% |
Current Function |
|
|
|
|
Translation_Entry::key |
2,248 |
32.50% |
82,700 |
6.50% |
Exclusive Metrics for Current Function |
|
|
51,014 |
61.70% |
Parent functions |
|
|
|
|
MO::import_from_reader |
1,758 |
78.20% |
64,243 |
77.70% |
Translations::translate_entry |
490 |
21.80% |
18,457 |
22.30% |
Child functions |
|
|
|
|
is_null |
4,496 |
96.60% |
30,450 |
36.80% |
chr |
160 |
3.40% |
1,236 |
1.50% |
※ 以前に一度プロファイリングやったのだけど解析や記録取りをしなかった。。今回は記録を残してみたが一番大変なのは、この記録を残すことのような。。