- From: Martin J. Dürst <duerst@it.aoyama.ac.jp>
- Date: Mon, 11 Jul 2016 19:32:25 +0900
- To: Poul-Henning Kamp <phk@phk.freebsd.dk>, Andy Green <andy@warmcat.com>
- CC: Julian Reschke <julian.reschke@gmx.de>, Yanick Rochon <yanick.rochon@gmail.com>, Phil Hunt <phil.hunt@oracle.com>, HTTP Working Group <ietf-http-wg@w3.org>
On 2016/07/11 14:55, Poul-Henning Kamp wrote: > -------- > In message <1468211839.6746.67.camel@warmcat.com>, Andy Green writes: > >> Actually it'd be nice, and efficient, if we could assemble one header >> payload in the library, pass it up to the application to copy or act >> on, and then reuse the buffer, as we go through the incoming, possibly >> fragmented, header content. > > Exactly. > > You also avoid the O(N^2) search operation to see if split headers > happened in the first place. There are many well-known data structures that avoid O(n^2). [I personally might try something like gperf (perfect hashing, see https://savannah.gnu.org/projects/gperf/) on a wide collection of well-known headers, which would make search for these headers O(1), and overall O(n) for n headers. Linear search (which leads to O(n^2) for a series of headers) could still be used on less well known stuff.] Regards, Martin.
Received on Monday, 11 July 2016 10:33:12 UTC