I recently had to handle heavy things with data stored in a DataSet. It was pretty hard, and I ended up using a tool to help identify some bottlenecks in my code. When I analyzed bottlenecks, I noticed that although the DataSet search was not terribly slow (they were not a bottleneck), it was slower than I expected. I always assumed that DataSets used some kind of HashTable style implementation that would create an O (1) search (or at least what I consider HashTables). The speed of my searches looked much slower than that.
I was wondering if anyone who knows anything about implementing the .NET DataSet class will be able to share what they know.
If I do something like this:
DataTable dt = new DataTable(); if(dt.Columns.Contains("SomeColumn")) { object o = dt.Rows[0]["SomeColumn"]; }
How fast will the search time be for the Contains(...) method and to get the value to store in Object o ? I would think this is very fast, like a HashTable (assuming I understand that HashTables is true), but it doesn't look like this ...
I wrote this code from memory, so some things may not be “syntactically correct”.
Dan herbert
source share