On mer, 2002-02-13 at 22:20, Brion Vibber wrote:
I ran "ab -n 10" on a couple pages running on my test server with various states: caching on, caching off w/ no removeHTMLtags() call, caching off with the old removeHTMLtags() code, and caching off with my new as-yet unoptimized but more secure version of removeHTMLtags(). The pages per second figures from three trials each:
Beryllium (large HTML table, various other tags)
- cached 2.06 2.06 2.16
- none 0.94 0.95 0.95
- old 0.90 0.90 0.89
- new 0.47 0.48 0.48
Esperanto-wiki mainpage: (a few <b>, <i>, and <font> tags)
- cached 3.26 3.13 3.47
- none 1.84 1.83 1.76
- old 1.82 1.80 1.80
- new 1.58 1.62 1.58
I've eliminated most of the loops from removeHTMLtags(), which is now only a couple of percent slower than the old function which let JavaScript through. Which is to say, still at >90% the performance of not doing live HTML tag removal, but still below a completely parsed cache.
Beryllium * cached 2.20 2.13 2.15 * none 1.00 0.98 0.98 * newest 0.92 0.92 0.93
Esperanto-wiki mainpage * cached 3.50 3.25 3.49 * none 1.87 1.89 1.87 * newest 1.86 1.82 1.80
Still room to optimize though,
-- brion vibber (brion @ pobox.com)