Re: StringBuilder Extension: IsQuotedBy
Frans Bouma <[email protected]> Fri, 15 Feb 2008 08:43:19 +0100
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <007b01c86fa6$6f2b44a0$4d81cde0$@nl> |
> You may say, this is for edge cases. Yes and no ... If object
> allocation was free, there would be no StringBuilder in the first
> place and it would not have a constructor asking for its initial size,
> etc.
That initial size is to prevent memory fragmentation during memcpy
actions when the buffer needs to be resized. I don't see a relevance with
object creation speed and that parameter. I think the main reason the string
builder is there is to avoid having lots of objects to collect. I file that
kind of action under 'object destruction', not 'creation', though if you see
that as one action (as creating an object means it also has to be collected at
some point), you have a point.
FB
>
> Sébastien
>
> On 2/14/08, Per Bolmstedt <[email protected]> wrote:
> > On Thu, 14 Feb 2008 11:42:01 -0500, =?ISO-8859-1?Q?S=E9bastien_Lorion?=
> >
> > <[email protected]> wrote:
> >
> >
> > > Allocating objects in a tight loop or methods like GetHashCode()
> > > is still a big nono ...
> >
> >
> > Why? See Chris' recent post, for example. Repeating the mantra isn't
really
> > helping. =]
> >
> >
> > ===================================
> > This list is hosted by DevelopMentor(R) http://www.develop.com
> >
> > View archives and manage your subscription(s) at
http://discuss.develop.com
> >
>
>
> --
> Sébastien
> www.sebastienlorion.com
>
> ===================================
> This list is hosted by DevelopMentor® http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentor® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com