Home > Archive > VC STL > March 2005 > Speed : Recordset or Map?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Speed : Recordset or Map?
|
|
|
|
Hi,
Is it faster to retrieve values from a recordset object, or from an STL map
object?
~Divya.
| |
| Fredrik Wahlgren 2005-03-08, 4:05 pm |
|
"Divya" <divya@epiance.com> wrote in message
news:Oul9D35IFHA.1948@TK2MSFTNGP14.phx.gbl...
>
> Hi,
>
> Is it faster to retrieve values from a recordset object, or from an STL
map
> object?
>
> ~Divya.
>
>
>
If you mean an ado recordset, my experience is that it takes long to find a
value.
/Fredrik
| |
| Stephen Howe 2005-03-08, 4:05 pm |
| > Is it faster to retrieve values from a recordset object, or from an STL
map
> object?
1) Why don't you measure it?
2) What do you mean by "retrieve"? On a STL map you can use member find(),
an O(log N) operation whereas searching for an element in a recordset is
O(N).
For small lookup tables, I use a sorted vector() and lower_bound().
Stephen Howe
|
|
|
|
|