Commit b8dedd0e authored by unknown's avatar unknown

Added a test to compare performance to DataTable (via IDataReader.GetValues)

parent 77dde933
...@@ -235,8 +235,37 @@ public void Run(int iterations) ...@@ -235,8 +235,37 @@ public void Run(int iterations)
} }
}, "hand coded"); }, "hand coded");
tests.Run(iterations); DataTable table = new DataTable
{
Columns =
{
{"Id", typeof (int)},
{"Text", typeof (string)},
{"CreationDate", typeof (DateTime)},
{"LastChangeDate", typeof (DateTime)},
{"Counter1", typeof (int)},
{"Counter2", typeof (int)},
{"Counter3", typeof (int)},
{"Counter4", typeof (int)},
{"Counter5", typeof (int)},
{"Counter6", typeof (int)},
{"Counter7", typeof (int)},
{"Counter8", typeof (int)},
{"Counter9", typeof (int)},
}
};
tests.Add(id => {
idParam.Value = id;
object[] values = new object[13];
using(var reader = postCommand.ExecuteReader())
{
reader.Read();
reader.GetValues(values);
table.Rows.Add(values);
}
}, "DataTable via IDataReader.GetValues");
tests.Run(iterations);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment