|
|
|
The first performance question has to do with fetching data. How long does
it take to fetch and display a recordset using each of the two techniques?
I broke the question down into two parts: 1) How long does it take to fetch
the data; and 2) How long does it take to navigate through the result set
in order to display it? To test the latter, I load a column from each row
into a standard ListBox (see Figure
1a).
The second performance question has to do with updating data through either
the VB variant or the recordset. What if the application usually has to
update only a small number of rows? What if it usually has to update the
entire recordset?
The tests were implemented in the following environment: compiled VB 5.0,
Access 97, Windows NT Workstation 4.0 with SP3, and ADO 2.0.
The performance results
Table 1 shows
the performance results for fetching data, then navigating and displaying
using both techniques. As you can see, as the number of rows in the result
set gets larger, the ADO Recordset actually provides better fetch performance,
but the Variant technique always shows better navigation performance.
Table 1.
Performance results for fetching data, then navigating and displaying using
both techniques.
Rows in table | Fetch (secs) | Navigate/display (secs) | ||
Variant: | Recordset: | Variant: | Recordset: | |
100 | 0.320 | 0.490 | 0.030 | 0.060 |
1,000 | 0.701 | 0.680 | 0.331 | 0.570 |
10,000 | 6.179 | 4.066 | 4.567 | 6.510 |
20,000 | 15.913 | 7.401 | 13.198 | 18.928 |
Rows in table | Update single row(secs) | Update all rows (secs) | ||
Variant: | Recordset: | Variant: | Recordset: | |
100 | 0.130 | 0.481 | 1.643 | 2.143 |
1,000 | 0.121 | 0.241 | 14.651 | 20.540 |
10,000 | 0.120 | 1.161 | 143.236 | 210.022 |