apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bp...@pacbell.net>
Subject [PATCH] performance improvement for apr_pstrcat
Date Thu, 27 Sep 2001 01:34:13 GMT
I instrumented apr_pstrcat and found that, in Apache 2.0, the number of
strings it's asked to concatenate is 6 or less 99+% of the time.

apr_pstrcat does two passes through its args: one to compute the
length, a second to do the copying.  This patch adds a buffer to
save the lengths of the first 6 args so that the second pass
doesn't need to another strlen on them.  (If you pass in more than
6 strings to concatenate, this optimization just gets applied to the
first 6.)


View raw message