プログラマが2chを救う!?

このエントリーをはてなブックマークに追加
read.cgiをプロファイラ(gprof)に掛けてみた結果
傾向がはっきりでるように1つのクエリに対してmain処理を1024回ループさせた

1) datが比較的大きい場合(130KB)

Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls us/call us/call name
42.76 1.21 1.21 1024 1181.64 1191.41 dat_read
37.46 2.27 1.06 1822724 0.58 0.58 findSplitter
6.01 2.44 0.17 455681 0.37 2.70 res_split
4.95 2.58 0.14 1020928 0.14 0.28 ExistHlinkX
4.59 2.71 0.13 5256192 0.02 0.02 hrefStop
1.77 2.76 0.05 455680 0.11 3.51 out_html
0.71 2.78 0.02 93184 0.21 0.21 cutWordOff
0.35 2.79 0.01 548864 0.02 0.55 ExistHlink
0.35 2.80 0.01 455680 0.02 0.70 hlinkReplace
0.35 2.81 0.01 93184 0.11 0.11 doReplace
0.35 2.82 0.01 1024 9.77 1572.27 dat_out
0.35 2.83 0.01 1024 9.77 9.77 getLineMax
0.00 2.83 0.00 455680 0.00 0.00 IsBusy2ch
0.00 2.83 0.00 7168 0.00 0.00 zz_GetString
0.00 2.83 0.00 2048 0.00 0.00 getFileSize
0.00 2.83 0.00 1024 0.00 0.00 BadAccess
0.00 2.83 0.00 1024 0.00 0.00 getFileLastmod
0.00 2.83 0.00 1024 0.00 0.00 get_lastmod_str
0.00 2.83 0.00 1024 0.00 0.00 html_foot
0.00 2.83 0.00 1024 0.00 0.00 logOut
0.00 2.83 0.00 1024 0.00 0.00 out_html1
0.00 2.83 0.00 1024 0.00 0.00 zz_GetEnv
0.00 2.83 0.00 1 0.00 0.00 html_head
続き
2) datが比較的小さい場合(13KB)

Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ns/call ns/call name
51.52 0.17 0.17 167940 1012.27 1012.27 findSplitter
42.42 0.31 0.14 1024 136718.75 136718.75 dat_read
3.03 0.32 0.01 41985 238.18 4287.25 res_split
3.03 0.33 0.01 1024 9765.62 9765.62 BadAccess
0.00 0.33 0.00 83968 0.00 0.00 ExistHlinkX
0.00 0.33 0.00 41984 0.00 0.00 ExistHlink
0.00 0.33 0.00 41984 0.00 0.00 IsBusy2ch
0.00 0.33 0.00 41984 0.00 0.00 hlinkReplace
0.00 0.33 0.00 41984 0.00 4287.35 out_html
0.00 0.33 0.00 7168 0.00 0.00 zz_GetString
0.00 0.33 0.00 2048 0.00 0.00 getFileSize
0.00 0.33 0.00 1024 0.00 175781.25 dat_out
0.00 0.33 0.00 1024 0.00 0.00 getFileLastmod
0.00 0.33 0.00 1024 0.00 0.00 getLineMax
0.00 0.33 0.00 1024 0.00 0.00 get_lastmod_str
0.00 0.33 0.00 1024 0.00 0.00 html_foot
0.00 0.33 0.00 1024 0.00 9765.62 logOut
0.00 0.33 0.00 1024 0.00 0.00 out_html1
0.00 0.33 0.00 1024 0.00 0.00 zz_GetEnv
0.00 0.33 0.00 1 0.00 0.00 html_head