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

  • Home
  • SEARCH
  • 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 67k
  • Answers 67k
  • 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 Basically, any time you want some other class to be… May 11, 2026 at 11:49 am
  • added an answer What you see on the screen of your iPhone is… May 11, 2026 at 11:49 am
  • added an answer As several others have pointed out in general this is… May 11, 2026 at 11:49 am

Related Questions

Recently I had to do some very processing heavy stuff with data stored in
I've recently had a need to do a bit of lisp editing and I
Recently I had to develop a SharePoint workflow, and I found the experience quite
I recently wrote a class for an assignment in which I had to store
I recently had to work on a project where the previous developer modified the
I recently had to take a quick look at Adobe InDesign server. In this
I recently had cause to work with some Visual Studio C++ projects with the
I've recently started developing applications for the Blackberry. Consequently, I've had to jump to
I recently had a need to interpret a DEC 32-bit floating point representation. It
I've recently had to dust off my Perl and shell script skills to help

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.