httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <>
Subject Re: SGI Patch 10xpatch-2.0a6-5 - eliminate use of sprintf() to format inet_ntoa conversions
Date Sat, 24 Feb 2001 00:41:54 GMT
On Fri, Feb 23, 2001 at 04:07:50PM -0500, Bill Stoddard wrote:
> I know as fact that sprintf() is pure performance evil.  We need to eliminate
> it everywhere possible in the server. This patch remove two calls to sprintf
> for each connection.
> This patch needs to be reworked to fit into inet_ntop.c.  Possibly  Resubmit
> and I will review and commit it (unless someone else calls out a severe
> problem that I don;t see).

The patch doesn't need to record the _len either. The mod_log_config
functions don't really return the length (which are the only usages below),
so there is no need to record it.

In the future, if we want to optimize away strlen() calls, then we should
introduced a "counted string" type. Subversion has one, along with a bunch
of support functions, which is APR pool-aware. We could snarf those if we
chose. [and place them into APRUTIL]

But I don't think we want to start recorded foo_len values hodge-podge.


Greg Stein,

View raw message