apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bp...@pacbell.net>
Subject [PATCH] optimization for APR sprintf functions
Date Thu, 02 May 2002 09:04:55 GMT
The strncmp() call used to detect quad formatting
directives accounts for about 10% of the execution time
of the apr_*printf() functions.  The static string used
in the comparison typically is only one or two characters
long, so calling a strcmp function is a very heavyweight
way to do the comparison.

This patch replaces the strncmp() with inline comparisons
of the one or two characters comprising the quad format
string.  It works, but it's ugly.

Can anyone suggest a cleaner way of doing this?

--Brian




Mime
View raw message