Performance of Find?

  • Thread starter Thread starter Jesper
  • Start date Start date
J

Jesper

I was wondering what kind of algorithm is behind the DataRowCollection.Find
method, where you are searching by the primary (and unique) key. Can I
expect "table-scan"-like performance O(n) or is there some sort of indexing
that makes it constant or logarithmic in performance?

I'm currently contemplating doing some complex sums, either in the DB
(which - of course - has the best performance on the actual calculations),
or in my client (which would remove the connection overhead, and improve
multiuser-scalability)

Jesper.
 
Jesper,

Why do you not just try it, this are very subjective questions.

What is performance?

It are in memory operations performed with JIT compiled code without an UI
action.

Mostly do you have to do those actions in a multiple loop to see really how
much time it takes in milliseconds.

Just my thought,

Cor
 
I'm looking for the 'performance' in terms of complexity. The raw numbers
are not really interesting to me, as I want to see how it all scales up. If
the Find command is just a complete traversal of the rows until it finds its
elements, then my application will not be able to scale well, and I wont
have any other choice but to go to the DB.
 
I would use ILDASM to look at the implementation. Quickly looking at it, it
looks like it tries to do some sort of primary key indexing. What happens
when there is no primary index, I didn't get that far.

JD
 
Back
Top