Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 61635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:21:00+00:00 2026-05-10T18:21:00+00:00

Recently I had to do some very processing heavy stuff with data stored in

  • 0

Recently I had to do some very processing heavy stuff with data stored in a DataSet. It was heavy enough that I ended up using a tool to help identify some bottlenecks in my code. When I was analyzing the bottlenecks, I noticed that although DataSet lookups were not terribly slow (they weren’t the bottleneck), it was slower than I expected. I always assumed that DataSets used some sort of HashTable style implementation which would make lookups O(1) (or at least thats what I think HashTables are). The speed of my lookups seemed to be significantly slower than this.

I was wondering if anyone who knows anything about the implementation of .NET’s DataSet class would care 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 would the lookup time be for the Contains(...) method, and for retrieving the value to store in Object o? I would have thought it be very fast like a HashTable (assuming what I understand about HashTables is correct) but it doesn’t seem like it…

I wrote that code from memory so some things may not be ‘syntactically correct’.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:21:01+00:00Added an answer on May 10, 2026 at 6:21 pm

    Via Reflector the steps for DataRow[‘ColumnName’] are:

    1. Get the DataColumn from ColumnName. Uses the row’s DataColumnCollection[‘ColumnName’]. Internally, DataColumnCollection stores its DataColumns in a Hastable. O(1)
    2. Get the DataRow’s row index. The index is stored in an internal member. O(1)
    3. Get the DataColumn’s value at the index using DataColumn[index]. DataColumn stores its data in a System.Data.Common.DataStorage (internal, abstract) member:

      return dataColumnInstance._storage.Get(recordIndex);

      A sample concrete implementation is System.Data.Common.StringStorage (internal, sealed). StringStorage (and the other concrete DataStorages I checked) store their values in an array. Get(recordIndex) simply grabs the object in the value array at the recordIndex. O(1)

    So overall you’re O(1) but that doesn’t mean the hashing and function calling during the operation is without cost. It just means it doesn’t cost more as the number of DataRows or DataColumns increases.

    Interesting that DataStorage uses an array for values. Can’t imagine that’s easy to rebuild when you add or remove rows.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 74k
  • Answers 74k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Since you already have to implement code to handle a… May 11, 2026 at 2:31 pm
  • added an answer There is no general way to determine the chipset unless… May 11, 2026 at 2:31 pm
  • added an answer Probably caused by this: Internet Explorer 6 introduced support for… May 11, 2026 at 2:31 pm

Related Questions

I'm using Delphi 2007 Pro. I have a runtime package that includes a number
I recently wrote some javascript code that filled a drop down list based on
I recently had some problems with my VS 2008, and was recommended to reinstall.
I recently upgraded from Delphi 4 to Delphi 2009. With Delphi 4 I had

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.