ADO.NET 2.0 brings with it some significant performance improvements. I recently heard Mark Dunn on .NET Rocks (an internet radio show that discusses all things .NET) discuss the tremendous speed improvement in filling an ADO.NET 2.0 DataTable.
According to Mark, filling a DataTable with 100,000 rows of data (which I have never attempted) takes approx 3 minutes in ADO.NET 1.1. Running the same exact code in ADO.NET 2.0 now takes around 3 seconds. That is over a 98% improvement! Transalation, what used to take a significant amount of time now takes almost no time in comparison.
Let's do the math:
3 mins = 180 seconds
180 seconds - 3 seconds = 177 seconds
177 seconds/180 seconds = 98.3%
I am going to setup a benchmark according to Mark's rough specs. I will write code to loop through and insert 100,000 records containing a static string of “Record” and adding the index of the current iteration (i.e. Record 0; Record 1...Record 999). I will trace the time before I enter the loop and immediately after.
Then I will compile and run the code using the 1.1 compiler and do the same using the latest Beta 2.0 compiler and post the results here.
Stay tuned.