Note that there are some explanatory texts on larger screens.

plurals
  1. POIs there any way to speed up datatable.LoadDataRow()?
    primarykey
    data
    text
    <p>I am refreshing a data table by calling <code>DataTable.LoadDatatRow</code> as follows: </p> <pre><code>public void FillTable(DataTable myTable, IEnumerable&lt;MyObject&gt; readings) { var index=0; foreach(var reading in readings) { LoadRow(myTable, reading, index++); } } protected override void LoadRow(DataTable table, MyObject objectValue, int index) { table.LoadDataRow( new object[] { objectValue.property1 + "a", objectValue.property2 + "b", /* ... etc. */ }, LoadOption.OverwriteChanges); } </code></pre> <p>Now, this is a little simplified for readability, and the <code>LoadDataRow</code> line is kind of long(roughly 9 array values), but contains no big function calls or anything, just formatting strings and a few <code>?</code> cases. This code works fine when I have ~50 values in my table, and I get about 10 Hz refresh. But once I get more values than normal(say, 200), it shoots up exponentially and I get ~0.2 Hz. This is way too slow. </p> <p>Does anyone have any idea why I'm getting exponential slowdown when I have a big readings enumerable? Is it something to do with <code>OverWriteChanges</code>(which I'm pretty sure I need for other reasons); or maybe creating an object within the <code>LoadDataRow</code>, or is there some other reason? </p> <p>I have played with different <code>LoadOptions</code> and that doesn't seem to be the problem. I just can't explain why I'm seeing such an enormous increase in processing time, and I can't figure out how to fix it. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload