[Mono-dev] Reverted patch 55895

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


Please review the reworked patch.

Regards,
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
Icaza
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

Hello,

> >    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
tries
> > the switch again (there is one special case to handle, header "TE",
but
> > that is all).
> 
> Actually, for the case insensitive path, I'd just use a hashtable
(with
> a case-insensitive hashcode). That avoids *any* allocations (and
avoids
> 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.

Miguel.
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
-------------- 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