Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Slow performance on culture
Message
De
21/12/2010 17:57:48
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01493324
Message ID:
01493535
Vues:
52
>You shouldn't do this on every culture formatting operation. Instead you should set your culture format once in the app and then re-use those settings for all format operations. If that's not possible for whatever reason then at least cache the CultureInfo structures in a Dictionary< string,CultureInfo > structure and retrieve the pre-set culture instead of recreating and re-customizing each time. Loading up a culture is expensive as .NET has to populate all those culture specific values from the OS each time.
>
>If this is a Web app you should do this once in the beginning of a request Application_BeginRequest and then simply use CultureInfo.
>
>You can find more info on this here:
>http://www.west-wind.com/presentations/wwDbResourceProvider/introtolocalization.aspx
>
>There's a section on "Assigning Culture in ASP.NET" that shows how to do this exact thing (setting the currency symbol specifically).
>
>In desktop applications you'd do the same thing either when the Application starts for the first time, or when the user switches locales (bad idea) on the fly within the application.

Thanks for the information

It is a Web app and it is bound to each user's configuration. So, the most I can do at startup, is to load and instance of each culture that is available, in this case English, French, Spanish and Portuguese, and associate that reference to an object later on. Having it done like that has resolved the issue.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform