[Mono-dev] Reverted patch 55895

Konstantin Triger kostat at mainsoft.com
Mon Jan 23 04:16:14 EST 2006

Please review the reworked patch.

Konstantin Triger

-----Original Message-----
From: mono-devel-list-bounces at lists.ximian.com
[mailto:mono-devel-list-bounces at lists.ximian.com] On Behalf Of Miguel de
Sent: Sunday, January 22, 2006 10:28 PM
To: Ben Maurer
Cc: mono-devel-list at ximian.com; Konstantin Triger
Subject: Re: [Mono-dev] Reverted patch 55895


> >    My suggestion is that you add at the end of the routine a call to
> > capitalize the string properly, so if we fail to find a match for a
> > string, say "content-lenght", it then capitalizes it properly and
> > the switch again (there is one special case to handle, header "TE",
> > that is all).
> Actually, for the case insensitive path, I'd just use a hashtable
> a case-insensitive hashcode). That avoids *any* allocations (and
> a linear search which one would get with using String.Compare).
> I'm not sure if this routine is performance critical enough to justify
> having two hashtables, one for a faster case sensitive compare and
> another for a correct insensitive comparison.
> In general, we shouldn't use ToLower/ToUpper for the purpose of case
> insensitive comparisons.

This is a fine optimization for the fall-back, but the default should
remain as it is.

Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HttpWorkerRequest.perf.patch
Type: application/octet-stream
Size: 1548 bytes
Desc: HttpWorkerRequest.perf.patch
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060123/6c85d18e/attachment.obj 

More information about the Mono-devel-list mailing list