his article benchmarks a few different ways to access data using ADO.NET. Hopefully, after seeing
the results of these tests, you will have a better idea concerning what approach to take when
accessing data with your application. The intention of this article is not to write the documentation
for ADO.NET. Microsoft has already written helpful documentation for ADO.NET (look in the PRC1 or
newer help files). We will, however, take a brief look at the overlying structure of ADO.NET.
The Tests
A VB.NET application written with Release Candidate one of .NET, executes several benchmark test.
Each test was run 5 times. Tests were run to retrieve 1, 10, 100, 1000 and 10,000 records. One set of
tests uses the SQLClient Managed Provider against a SQL Server data source. The second set of tests
use the OleDb Managed Provider against the same Sql Server database.
The test data contains the 1990 US Census summary of Last Names. The table contains 80,000+ records.
Each record contains four fields. The data resides in a SQL Server 2000 database.
Benchmarks performed include the following:
| SQLClient Managed Provider | DataReader |
|---|---|
| DataSet/DataTable | |
| OleDb Managed Provider | DataReader |
| DataSet/DataTable |
The Machine
| Motherboard: | Soyo Dragon Plus |
| Memory: | 512MB Crucial DDR RAM |
| Processor: | AMD XP 1.5GHZ |
| Disk: | Seagate 40GB 7200 |
|
SQL Client |
SQL Client |
OLEDB |
OLEDB | |
|
Records |
DataReader |
DataTable |
DataReader |
DataTable |
|
1 |
0.0000000 |
0.0801152 |
0.0000000 |
0.1001440 |
|
10 |
0.0000000 |
0.1001440 |
0.200288 |
0.9012960 |
|
20 |
0.0000000 |
0.1802592 |
0.100144 |
1.9027360 |
|
30 |
0.0100144 |
0.2804032 |
0.100144 |
2.8040320 |
|
40 |
0.0100144 |
0.3705328 |
0.100144 |
3.7053280 |
|
50 |
0.0100144 |
0.4706768 |
0.200288 |
4.7067680 |
|
60 |
0.0100144 |
0.5608064 |
0.200288 |
5.6080640 |
|
70 |
0.0200288 |
0.6509360 |
0.200288 |
6.5093600 |
|
80 |
0.0200288 |
0.7410656 |
0.200288 |
7.4106560 |
|
90 |
0.0200288 |
0.8412096 |
0.300432 |
8.3119520 |
|
100 |
0.0300432 |
0.9313392 |
0.300432 |
9.3133920 |
|
SQL Client |
SQL Client |
OLEDB |
OLEDB | |
|
Records |
DataReader |
DataTable |
DataReader |
DataTable |
|
100 |
0.0400576 |
0.9313392 |
0.300432 |
9.6138240 |
|
200 |
0.0600864 |
1.7825630 |
0.600864 |
17.8256300 |
|
300 |
0.0801152 |
2.6638310 |
0.901296 |
26.7384500 |
|
400 |
0.1101584 |
3.5551120 |
1.101584 |
35.5511200 |
|
500 |
0.1402016 |
4.4463930 |
1.402016 |
44.4639400 |
|
600 |
0.1702448 |
5.3376750 |
1.802592 |
53.3767500 |
|
700 |
0.2002880 |
6.2289570 |
2.00288 |
62.6901400 |
|
800 |
0.2303312 |
7.1202380 |
2.303312 |
71.1022400 |
|
900 |
0.2703888 |
8.0015060 |
2.603744 |
80.0150500 |
|
1000 |
0.2904176 |
8.8927870 |
2.904176 |
88.9278700 |
|
SQL Client |
SQL Client |
OLEDB |
OLEDB | |
|
Records |
DataReader |
DataTable |
DataReader |
DataTable |
|
1000 |
0.3004320 |
8.9628880 |
3.104464 |
90.5301700 |
|
2000 |
0.6108784 |
18.3463800 |
6.00864 |
178.1562000 |
|
3000 |
0.9313392 |
26.7785100 |
9.113104 |
267.3845000 |
|
4000 |
1.2317710 |
35.7013400 |
12.21757 |
356.5126000 |
|
5000 |
1.5221890 |
44.6542100 |
15.42218 |
446.0414000 |
|
6000 |
1.8827070 |
53.8073700 |
18.4265 |
553.4959000 |
|
7000 |
2.1931540 |
63.5113300 |
21.03024 |
636.4151000 |
|
8000 |
2.4334990 |
72.8046900 |
23.93442 |
726.8452000 |
|
9000 |
2.7639740 |
81.7876100 |
27.43946 |
832.7975000 |
|
10000 |
3.0844350 |
91.6217400 |
31.14478 |
911.7110000 |
| DevX is a division of Jupitermedia Corporation © Copyright 2007 Jupitermedia Corporation. All Rights Reserved. Legal Notices |