Performance and Regional Settings

  • Thread starter Thread starter Thomas Pettersen
  • Start date Start date
T

Thomas Pettersen

Hi!

I have a wierd thing going on to an application that we have deployed in
Norway, Denmark and Sweden.

We're doing a lot of looping where we're checking dates, converting dates
and numbers.

The following code takes with English U.S. Settings (+ Norwegian and danish)
2.6 seconds on my computer.
When I change to Swedish it takes more than 6 seconds.

For i = 0 To 3000000
blnResult = IsNumeric(strTest)
Next

I have changed convert and isnumerics-methods to faster methods, but we're
using XML-serialization on quite big objects with a lot of dates, and we
have the same performance problem there.

Is this a bug in Windows? I've tried this on WinXP, but it also occurs on
Win 2003 server. Can anyone in Microsoft explain the reason for this? (or
send me a bugfix. :) )

:) Thomas Pettersen
SKUM
 
Hi Thomas,

Thanks for your post. I am currently finding appropriate resources to help
you with this issue, we will update you with our findings as soon as
possible.

Have a nice day!

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Hi Thomas,

It would first seem to me that you are experiencing an issue related to:

325330 FIX: Numeric Values Do Not Parse Correctly in Visual Basic .NET When
You
http://support.microsoft.com/?id=325330

But, you say that the problem reproduces on a Windows 2003 machine which
has 1.1 of the framework.

I tested your code with Swedish regional settings, but was unable to
reproduce it on a Windows 2003 machine running 1.1 of the framework.

Can you post your full test code for me to test?
Did you develop this app with VS.NET 2002 or 2003?

Kind Regards,

Félix Lima
Microsoft Developer Support
Visual Basic and Visual Basic .NET
 
Hi Thomas,

OK. After some more testing, I have reproduced your issue. It seems as
though the fix from Q325330 may have come with a performance bottleneck
which I will look into.

As a workaround, you can try the following which seems to have the same
performance regardless of language:

For i = 0 To 3000000
blnResult = Double.TryParse(strTest,
Globalization.NumberStyles.Any, Nothing, Nothing)
Next

Kind Regards,


Félix Lima
Microsoft Developer Support
Visual Basic and Visual Basic .NET
 
Back
Top