httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <>
Subject [PATCH] speedup for apr_table_t
Date Sat, 17 Nov 2001 08:42:31 GMT
This patch adds a cache to each element in an apr_table_t.
The cache consists of a 32-bit int containing the first 4 bytes
of the element's key, converted to uppercase.

This makes it possible to replace strcasecmp calls with inline
integer comparisons.  If the integer comparison fails, we can skip
the strcasecmp.  If the integer comparison succeeds, we can at
least skip the first 4 bytes of the strcmp.

In the httpd, this roughly doubles the speed of the
apr_table_get and apr_table_setn operations.

Two important notes:
* This patch increases the size of the apr_table_entry_t struct,
  so it requires a "make clean."
* The addition of an extra int to the apr_table_entry_t breaks
  mod_isapi.c, which assumes that the struct contains nothing
  but char* fields.  The patch includes a diff for mod_isapi.c
  to fix this, but that part is untested because I don't have
  a win32 compilation environment.


View raw message