cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH v3] rawstr: Speed up Curl_raw_toupper by 40%

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 3 Nov 2015 13:02:14 +0100 (CET)

On Tue, 3 Nov 2015, Tim Ruehsen wrote:

> Curl uses a linked list for cookies. That's fine when you have just a bunch
> of entries. Adding an entry takes O(n^2). Using a hash table would reduce it
> to O(n). In other words: if 10k entries now take 1s, with a hashtable it
> would be (best case) 0.1ms. With a bunch of overhead per entry (a constant
> factor to be multiplied to the 0.1ms), let's say it is 1ms for 10k entries.
>
> Curl has a hash API, so it should be straight forward to improve the cookie
> code.

I can only agree. The cookie code was not written to handle such a vast amount
of cookies effectively.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2015-11-03