Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Slow performance on culture
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01493324
Message ID:
01493570
Views:
40
>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.

Um - isn't this just what Michel said he was going to do at the beginning of this thread ?

>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.
>
>+++ Rick ---
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform