Joe Schaefer <[EMAIL PROTECTED]> writes: [...]
> oprofile tells me this version wins by ~10 - 25% when measuring the > time httpd spends in table ops. To get the full benefit, > ap_get_mime_headers_core in httpd-2.0/server/protocol.c also > needs a patch. FWIW here's the oprofile data. The sample data was generated by running 3 passes of (here "/foo" is a zero-byte file) % ab -H "Accept-Language: en" -H "Accept-Encoding: gzip" \ -H "Accept-Charset: *" -H "Referer: http://localhost/" \ -H "Cookie: foo=bar" -n 50000 -c 50 http://127.0.0.1:8080/foo for each of 3 cases: 1) current, 2) just apr patched, and 3) both apr + httpd patched The results were obtained via: % op_time -rl /home/joe/apache2/bin/httpd | perl -nal \ -e 'if (/table|overlap/) { $ops += $F[1]; $pct += $F[2]; print }' \ -e 'END { printf "\nTOTAL:\t %d \t %.6f %%\n", $ops, $pct }' -------------------------------------------------- CURRENT: 0000c1cc 627 1.33444 apr_table_get ... 0000cf00 348 0.740646 overlap_hash ... 0000c4dc 334 0.71085 apr_table_setn ... 0000d13c 302 0.642745 apr_table_overlap ... 0000c050 206 0.438428 apr_table_make ... 0000cbbc 183 0.389478 apr_table_addn ... 0000c9c8 162 0.344784 apr_table_mergen ... 0000c144 158 0.33627 table_reindex ... 0000c6e4 107 0.227727 apr_table_unset ... 0000ccd0 89 0.189418 apr_table_vdo ... 0000c02c 78 0.166007 apr_table_elts ... 0000cca8 44 0.0936449 apr_table_do ... 0000c034 18 0.0383093 apr_is_empty_table ... TOTAL: 2656 5.652747 % -------------------------------------------------- APR PATCHED, HTTPD UNPATCHED: 0000c65c 518 1.16785 apr_table_get ... 0000c41c 282 0.63578 apr_table_compress ... 0000c968 267 0.601961 apr_table_setn ... 0000c194 235 0.529816 apr_table_make ... 0000d3a4 224 0.505016 apr_table_addn ... 0000d430 176 0.396799 apr_table_cat ... 0000d008 174 0.392289 apr_table_mergen ... 0000d7d4 103 0.232217 apr_table_overlap ... 0000d614 103 0.232217 apr_table_vdo ... 0000d5ec 80 0.180363 apr_table_do ... 0000c144 72 0.162327 apr_table_elts ... 0000cb70 51 0.114981 apr_table_unset ... 0000c14c 26 0.058618 apr_is_empty_table ... TOTAL: 2311 5.210234 % -------------------------------------------------- BOTH APR & HTTPD PATCHED: 0000c65c 508 1.12834 apr_table_get ... 0000c968 234 0.519746 apr_table_setn ... 0000c194 218 0.484208 apr_table_make ... 0000d430 202 0.44867 apr_table_cat ... 0000c41c 188 0.417574 apr_table_compress ... 0000d3a4 187 0.415352 apr_table_addn ... 0000d008 145 0.322065 apr_table_mergen ... 0000d614 95 0.211008 apr_table_vdo ... 0000d7d4 83 0.184354 apr_table_overlap ... 0000d5ec 55 0.122162 apr_table_do ... 0000c144 52 0.115499 apr_table_elts ... 0000cb70 44 0.09773 apr_table_unset ... 0000c14c 25 0.0555284 apr_is_empty_table ... TOTAL: 2036 4.522236 % -------------------------------------------------- Is anyone interested in applying the patch? If so, soon afterwards I'd like submit another patch to this patch, which includes unit tests for the new functions, fixes the current testtable.c (since the test arguments are all incorrectly ordered), and reflects the correct behavior for APR_OVERLAP_TABLES_SET. -- Joe Schaefer