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 96461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:49:06+00:00 2026-05-10T23:49:06+00:00

I am creating a mock database for import export tests (of the algorithm reading

  • 0

I am creating a mock database for import export tests (of the algorithm reading and writing complex data structures to our database, not just to test IO operations), and am trying to decide whether to use a DataSet to store the mock tables (by table name) in the faux-database, or Dictionary()

In terms of retrieving a datatable by name, would I expect better performance from, dataset.Tables[‘TableName’] or dictionary<‘TableName’> (from Dictionary()?

  • 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-10T23:49:07+00:00Added an answer on May 10, 2026 at 11:49 pm

    Actually, Dictionary<,> is often slower than a linear search, due to the inherent complexities of doing the dictionary logic (haches, buckets, etc). In my tests, the cutoff (where Dictionary<,> starts being faster) is often around 150 elements. And since you generally have a lot fewer tables than 150, I’d be happy with a linear list for performance.

    (which doesn’t at all mean ‘don’t use Dictionary<T>; it just means that performance might not be the main reason for this particular use-case; the unique key enforcement and the foo[‘bar’] model might be)

    Part of this is due to the complexity of getting the hash – the GetHashCode() for string in particular is relatively expensive (although int.GetHashCode() is blindingly fast ;-p).

    In reality, in most small sets of data you will never notice the difference between the two. If you have large data, then obviously you need to plan for that and code accordingly.

    Other differences between a Dictionary<,> and something like a List<> is things like uniqueness: a Dictionary<,> won’t let you have duplicated keys (although a Lookup<,> in .NET 3.5 will).

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

Sidebar

Ask A Question

Stats

  • Questions 115k
  • Answers 115k
  • 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
  • Editorial Team
    Editorial Team added an answer Update Data Set data.Country = Translations.[To] From Data Inner Join… May 11, 2026 at 10:28 pm
  • Editorial Team
    Editorial Team added an answer There's no functionality in the GWT compiler that lets you… May 11, 2026 at 10:28 pm
  • Editorial Team
    Editorial Team added an answer Nope. That's pretty good. From The Zen of Python: "Simple… May 11, 2026 at 10:28 pm

Related Questions

I am curious what strategies folks have found for unit testing a data access
I'm creating a series of builders to clean up the syntax which creates domain
I am trying to test a class that manages data access in the database
I have a C application that I've created in VS2008. I am creating a

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.