We have a .NET application written in VB.NET 4.0 / VS2010, compiled with all projects installed in AnyCPU settings for Debug and Release configuration. We noticed that when this application runs in a 64-bit environment (tested on Windows Server 2003 R2 and 2008 R2), the application then takes at least twice as much (in absolute terms about 25 seconds), and not about 6-12 seconds in 32-bit environment (Win XP and 7) to run.
I must add that 64-bit systems are powerful servers, definitely more powerful than other 32-bit systems under test. All other applications were faster on 64-bit, but not on our poor application;) (And we tested the applications at different times, under different loads, and the results are always almost the same.)
As mentioned above, the application is built using AnyCPU and works as a 64-bit build under a 64-bit OS (checked through the TaskManager). The application itself is a WinForms application using NetAdvantage Forms v10.3 and regularly querying and writing to MS SQL Server 2008.
Different target computers are on the same network, so the database path (the same database was used for performance tests), for example, is the same, I don’t think the problem is with the database or the network itself.
One thing that I noticed, which seemed strange to me, was that when I built different “profiling steps” using a stopwatch while starting our MainForm, the InitializeComponent method took twice as much by 64 bits, about 4 seconds versus 1 , 5 by 32 bits.
This is the same application that we deploy on both systems, without a different configuration.
So, I have two questions:
Any idea what could be the reason for this?
And: What is the best way to identify “offensive” code snippets? I am currently using stopwatch and trying to narrow it down. But it seems to me that on 64-bit machines everything is slower than our application, so I'm not sure that I can break it down into specific statements.
Thank you all for your help, really appreciate ...