httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoj Kasichainula <>
Subject [PATCH] util.c optimization
Date Tue, 30 Mar 1999 22:58:02 GMT
Attached is a patch to optimize three functions in util.c. It's based
off of the apache-apr repository, but it should apply pretty easily to
apache 1.3.

The first hunk of the patch is a complete rewrite of util.c. In
profiling, we found that in a core-only server with Dean's
highperformance.conf, ap_vformatter was taking up around 4% of all the
cycles, with 4 calls per request. Two of those calls were from
ap_gm_timestr_822. Rewriting this function not to use ap_vformatter,
made it use less then half of the cycles, so I expect performance of a
server to increase by around 1.1%. The disadvantage of this change is
that the code is harder to understand. Also, the code is dependant on
a 4-digit year. It wouldn't be hard to fix it to not have a y10k
problem, though.

The next hunk is an optimization of ap_make_dirstr_prefix. The logic
is just rearranged a bit, and this speeds up the function by around

The final hunk is an optimization of ap_unescape_url. There are two
changes here. The first is to not bother assigning characters before
finding any '%' characters. The second is to use pointer arithmetic.

These three patches put together should improve performance in a
core-only server by around 1.4%. Thoughts?

View raw message