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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:52:14+00:00 2026-05-16T05:52:14+00:00

I am developing a multilingual ASP.NET web site. I want the users to be

  • 0

I am developing a multilingual ASP.NET web site. I want the users to be able to add translations ‘on the fly’ therefore I am storing the translations in a database and maintaining an ASP.NET Application object containing all the translations (for performance). I am using a simple Hashtable to store the translations, then I store this in the Application object and reference it when rendering the page.

Some of the translation entries are short, some are long. It all depends upon what the user wants translated. Whenever the site is rendering, say, control labels or help text, it checks the Hashtable to see if it contains a translation for the English version and if it does then it uses the Hashtable version (assuming a foreign-language user – I use separate Application-level objects for each language).

A typical Hashtable entry might be: key=’Things to do today’, value=’Mon Charge pour aujourd’hui’. The code looks up the table for ‘Things to do today’ – if a translation is found it uses it, if not it just uses the English version.

My question is this: is a Hashtable the most performant collection for this? Could I somehow improve performance/memory usage by using a different collection/key structure, or even using a different mechanism altogether? My thinking is that I’d rather use the Application object rather than doing distinct database reads for each translation – there may be tens of translations per page render.

  • 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. Editorial Team
    Editorial Team
    2026-05-16T05:52:15+00:00Added an answer on May 16, 2026 at 5:52 am

    I think that memory is not so much of an issue given the number of bytes you always have to store is more or less constant. The keyvalue mapping size is equivalent, no matter what mechanism you use.

    However, for performance this does not hold. When using a keyvalue collection (like eg hashtable or dictionary), the hash that is used in the dictionary is calculated using the input. I.e. if your key is “abcdefg” it is hashed using the GetHashcode() function. This function obviously uses more computational power if your input to gethashcode (i.e. the input string abcdefg) is longer.
    You can for example make the gethashcode a constant function O(1) in terms of the length of the string by overriding the function and let it return a hashcode based on a constant number of input characters of your string. Of course this could brake the balance of your hashtable, resulting in slower lookups. You should benchmark this to be sure.

    Another solution is to keep a dictionaries/hashtables for each language and use as key some short abbriviation. On lookup you will then have a switch statement which picks the correct dictionary and extracts the string using the abbrivated key. The downside of this is that you increase memory usage, but in theory decrease lookup time. Also in this case you have to benchmark in order to be sure if there is any (positive) difference.

    As as sidenote, this sounds to me as a premature optimization. I dont think that such lookups will be a bottleneck to you application.

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

Sidebar

Related Questions

Developing a multilingual application in VB.Net 2008, Im able to add resources to forms
I am tasked with developing a multi lingual site using ASP.NET MVC. For static
I'm developing a multilingual web site and the localization is done mostly by using
I'm developing a web application using ASP.NET MVC (I'm new to the framework and
I just started developing a multilingual webpage which site users can read and post
I am developing a multilingual web application that has a nice looking UI. I
I'm trying to implement multilingual indexes for the web application I'm developing. At the
I am developing a site using php and mysql. I want to know... what's
I'm developing a multilingual PHP web application, and I've got long(-ish) texts that I
I am developing my first multilingual C# site and everything is going ok except

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.