On Fri, 5 Jul 2002 20:19:30 +1000, Nick Wienholt <[EMAIL PROTECTED]>
wrote:

>I am seeing something very different from your results.
>
>1.  An initial capacity is much better for performance. (x3 better for no
>boxing)

That is odd.  It is most definitely a wash on my system (even a few ms
slower) in both C# and C++.

Anyway, my comment about preallocation was directed toward the cases of
dynamically allocated objects (case C & D).  I consider the boxing case to
be more interesting since, in an objected oriented design you will not
generally have arrays of basic types (int, double).

I think the point is that in general the allocations for all the objects
within the array will is the overwhelming factor.

>2.  Not too much difference between builds, but release definitely better.

Ops, I wasn't clear that Debug and Release are for C#.

                                               C# builds
                                  ____________/
                                 /            \
> >                            | Debug  Release  Release
> >   Boxing Initial Capacity  |    ms       ms   C++ ms
> >   ------ ----------------  | -----  -------  -------
> > A     No              Yes  |   300      260     1061
> > B     No               No  |  1271     1281      981
> > C    Yes              Yes  |  7590     7701     3144
> > D    Yes               No  |  6889     7010     2954

I just found it mildly interesting that there was not a bigger difference
between debug and release builds.

Cheers...David

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to