cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCHES RFC 2/2] Optional hash table improvements

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 2 May 2007 16:21:35 +0200 (CEST)

On Tue, 1 May 2007, Robert Iakobashvili wrote:

> 1) curl-hash.patch - makes hashing more flexible and optimized
> for every particular type of data;

Nice! Two things:

hash_fd() is added as a library-wide symbol. If it should remain so, it should
be Curl_ prefixed, but it seems to only be used from within multi.c so I
suggested it is moved there and made static. What do you say?

fd_key_compare seems to be in the same position.

> return ((fd < (int)slots_num) ? fd : fd % (int)slots_num);

Is this complication really necessary? I mean, why not just do it:

   return fd % (int)slots_num;

?

> 2) curl-socket-hash-table-size.patch - is a very optional patch
> improving the performance only above 10K curl handles;

I figure upping that size is okay. Possibly we should consider a way to either
let the app somehow set it or perhaps allow it to grow somehow. Of course we
can even consider a different hash implementation that can deal with 10 or
10000 entries in a way that doesn't require us to change a fixed array size
like this.

I mean, if someone goes mad and tries 100,000 connections they probably will
see that upping this size even more will be very beneficial to them...

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-05-02