summaryrefslogtreecommitdiff
path: root/include/apr_tables.h
diff options
context:
space:
mode:
authorianh <ianh@13f79535-47bb-0310-9956-ffa450edef68>2001-11-26 16:25:52 +0000
committerianh <ianh@13f79535-47bb-0310-9956-ffa450edef68>2001-11-26 16:25:52 +0000
commite2f79a5706301f02ca8031e6d9bcd07c5b055af0 (patch)
treec8d804a4df68ece180a26d5a83eddd1f41523038 /include/apr_tables.h
parent40eb92314e12156339c4625508c4126f4f5e1385 (diff)
downloadlibapr-e2f79a5706301f02ca8031e6d9bcd07c5b055af0.tar.gz
Speed up table operations.
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. * A rewrite of apr_table_overlap() that uses a red-black tree instead of qsort * Cliff's faster version of the prefix computation macro * apr_palloc instead of apr_pcalloc for creating the array inside a table an important note: * This patch increases the size of the apr_table_entry_t struct, so it requires a "make clean." Submitted by: Brian Pane <bpane@pacbell.net> Reviewed by: Ian Holsman, Cliff Woolley git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62547 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_tables.h')
-rw-r--r--include/apr_tables.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/apr_tables.h b/include/apr_tables.h
index 27704b814..238605e16 100644
--- a/include/apr_tables.h
+++ b/include/apr_tables.h
@@ -130,6 +130,9 @@ struct apr_table_entry_t {
*/
/** The value for the current table entry */
char *val;
+
+ /** A checksum for the key, for use by the apr_table internals */
+ apr_uint32_t key_checksum;
};
/**