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 fixes for number formatting
Date Sun, 15 Jul 2001 14:19:51 GMT
In profiling the httpd, I've found the conv_10 function
(used in the implementation of "%d" for the apr_*printf
functions) to be one of the top 10 consumers of user-mode
CPU time.  There are a small number of places in the httpd
that cause most of the calls to this function.

The attached patch fixes the problem.  It includes two
changes to APR:
  * new functions apr_itoa, apr_ltoa, and apr_off_t_toa
    that provide itoa-type functionality based on pools
  * Inline code in inet_ntop4 to replace sprintf for converting
    binary IP addresses into dotted-decimal format
and two changes to Apache:
  * use the apr_itoa functions in setting the content length,
    in place of apr_psprintf
  * use the apr_itoa functions to replace frequent uses of
    'sprintf("%d",...)' in mod_log_config.


View raw message