M
mitch
if pc is a collection object (i.e. derives from CollectionBase) and
contains objects which have a GetX() accesser and I do the followingtwo
things:
p = pc[0];
for(int n = 0; n < 100000000; n++)
{
double x = p.Getx();
}
the loops runs in 0.3 seconds
if however I have:
for(int n = 0; n < 100000000; n++)
{
double x = pc[0].Getx();
}
it take 6 seconds!
What's going on. Are .NET collections this slow or am I missing
something?
Thanks for any advice on implementing a fast collection in c#,
Mitch.
contains objects which have a GetX() accesser and I do the followingtwo
things:
p = pc[0];
for(int n = 0; n < 100000000; n++)
{
double x = p.Getx();
}
the loops runs in 0.3 seconds
if however I have:
for(int n = 0; n < 100000000; n++)
{
double x = pc[0].Getx();
}
it take 6 seconds!
What's going on. Are .NET collections this slow or am I missing
something?
Thanks for any advice on implementing a fast collection in c#,
Mitch.