Re: StringBuilder Extension: IsQuotedBy

Frans Bouma <[email protected]> Thu, 14 Feb 2008 15:16:24 +0100
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <00e301c86f14$2dffff80$89fffe80$@nl>
> On Thu, 14 Feb 2008 12:28:29 +0100, Frans Bouma <[email protected]> wrote:
>
> > creating objects is indeed a bit expensive in .NET,
>
> I've heard the exact opposite. And I find this hard to relate to as a
> general statement... could you put this in perspective? Is it more expensive
> in .NET than on comparable platforms, or is it more expensive in .NET than
> comparable implementations that do not create objects?

        Our o/r mapper framework uses per entity an array of field objects,
which are used as a DTO between the entity object and the core object fetcher.
During profiling of the fetch logic, we ran into this: creating a lot of
entities with a lot of fields means creating a LOT of field objects. We saw
that it was a (small) bottleneck in our framework, as in: creating the objects
did add some costs to the overall time a fetch of a set of entities takes.

        This wasn't expected, I too believed that creating objects was so fast
you didn't noticed AT ALL. It's not THAT slow that it's very noticable when
you create objects. But when you profile code which creates a lot of objects,
you'll see you lose time to the creation of the objects. Even if it's just 5%
of the execution time, it is still 5%. :)

                FB

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com