Posted 24 September 2018, 8:35 pm EST
Here’s my test
for (int pass = 1; pass <= 10; pass++)
{
var t = new RenderTable(pass*100, 32);
var DT = DateTime.Now;
for (int r = 0; r < t.Rows.Count; r++)
for (int c = 0; c < t.Cols.Count; c++)
{
var Cell = t.Cells[r, c];
}
TimeSpan ts = DateTime.Now - DT;
textBox1.AppendText(t.Rows.Count.ToString() + " " + ts.TotalSeconds.ToString()+" "+new TimeSpan(ts.Ticks/pass).TotalSeconds.ToString()+"\r\n");
}
Output: (truncated the values a bit for readability)
100 0.17 0.17
200 0.65 0.32
300 1.49 0.49
400 2.77 0.69
500 4.27 0.85
600 6.86 1.14
700 9.79 1.39
800 12.1 1.52
900 15.2 1.69
1000 19.1 1.91
The traverse time for the table increases exponentially with the number of rows in the table. From 0.17sec per 100 rows to 1.91sec per 100 rows in a table with 1000 rows.
Why?