Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 17969 invoked by uid 500); 8 Sep 2001 20:54:01 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 17950 invoked from network); 8 Sep 2001 20:54:01 -0000 Date: Sat, 08 Sep 2001 13:51:06 -0700 From: Brian Pane Subject: Re: [PATCH] Turn apr_table_t into a hash table To: rbb@covalent.net Cc: dev@httpd.apache.org, dev@apr.apache.org Message-id: <3B9A84BA.7070607@pacbell.net> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3) Gecko/20010801 References: <3B993AEB.8040602@pacbell.net> <20010908153211.A49E046DF4@koj.rkbloom.net> <3B9A6371.1000204@pacbell.net> <20010908202001.2EE4646DF4@koj.rkbloom.net> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Ryan Bloom wrote: >On Saturday 08 September 2001 11:29, Brian Pane wrote: > >>Ryan Bloom wrote: >> >>>On Friday 07 September 2001 14:23, Brian Pane wrote: >>> >>>>The attached patches change the apr_table_t implementation from >>>>a linear list to a hash table (not an apr_hash_t, though!). With >>>>this change, I'm seeing a ~3% improvement in throughput when >>>>delivering a 0-byte file over the loopback on Linux. (I used this >>>>0-byte test case to measure the inherent overhead in the httpd, without >>>>transmission time clouding the results.) >>>> >>>I dislike this. Why are we putting a second hash table into APR? If we >>>want to use a hash, then ues an apr_hash_t. If apr_hash_t doesn't >>>support something that we MUST have to do this, then fix apr_hash_t. >>>Having two different hash alorithms in APR, one of them hidden under a >>>tables API, seems kind of hackish to me. >>> >>Are you arguing in favor of using apr_hash_t in the implementation of >>apr_table_t, >>or using apr_hash_t in place of apr_table_t in the request_rec? I'm >>comfortable >>with the former, but not the latter. >> > >The latter. Having two API's to the same functions should only be done >as a stop-gap. > I disagree. It's inevitable to have two APIs, as long as we have two 'table' types with very different semantics. apr_table_t is statically typed (uses char*), and apr_hash_t isn't (uses void*). If we did a direct replacement of apr_table_t with apr_hash_t in the httpd, we'd be sacrificing static type-safety for a lot of code. > Also, a LOT of modules using the apr_table_elem macro >to get the elements from a table. Turning that into an API would break a >lot of people. > My patch covers all the changes needed for the core modules. Do you have any info on the number of 3rd-party modules for 2.0 that use apr_table_elem? --Brian