Skip to content

Commit

Permalink
Added a test to compare performance to DataTable (via IDataReader.Get…
Browse files Browse the repository at this point in the history
…Values)
  • Loading branch information
unknown committed May 24, 2012
1 parent 77dde93 commit b8dedd0
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion Tests/PerformanceTests.cs
Expand Up @@ -235,8 +235,37 @@ public void Run(int iterations)
}
}, "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);
}

}
Expand Down

0 comments on commit b8dedd0

Please sign in to comment.