Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Creating DataTable performance problem

1 view
Skip to first unread message

Michael Kugler

unread,
Mar 28, 2010, 3:16:12 PM3/28/10
to
Hi,

I have some performance problems creating a DataTable. I do some
calculations on the GPU with openCL. The calculations and returning the 64
mio rows takes about 0.19 sec.
Creating the datetable out of the array takes about 2 minutes :-(
Curently I do the creation like this (I already thought about
multithreading but i want the result sorted):
)
float[] result;
result=MatrixCalculationOpenCL(xSource, ySource, xDestination,
yDestination);
DataTable dt = new DataTable("AddressToAddress");
dt.Columns.Add("SourceAdress",typeof(int));
dt.Columns.Add("DestinationAddress", typeof(int));
dt.Columns.Add("Distance", typeof(float));

for (int i = 0; i < iSourceAdress.Length; i++)

{
for (int ii = 0; ii < iSourceAdress.Length; ii++)
{
DataRow dr;
dr = dt.NewRow();
dr.ItemArray[0] = iSourceAdress[i];
dr.ItemArray[1] = iSourceAdress[i];
dr.ItemArray[2] = result[(i*iSourceAdress.Length)+ii];
dt.Rows.Add(dr);
}
}


Regards

Michael

Andy O'Neill

unread,
Mar 29, 2010, 5:38:10 AM3/29/10
to

"Michael Kugler" <m...@compunited.eu> wrote in message
news:BA0F841B-D9BF-4E7E...@microsoft.com...

> Hi,
>
> I have some performance problems creating a DataTable. I do some

Why do you need a datatable?
A typed list would be quicker.
Just using your array would be instant.

So why a datatable?

0 new messages