.NET 2.0 application ('Any CPU') running s

2019-05-26 23:16发布

问题:

My Windows application is deveoped on .NET 2.0 Framework and is build using 'Any CPU', development enviroment is 32-bit OS + Visual Studio 2005.

Now I am deploying this application on 64-bit processoer + 64-bit OS it is running slow.

But if I build using x86 (32 bit), it is working fine without any issue on a 64-bit processor + 64-bit OS.

I have third-party components like DevExpress, Janus, txtext, ComponentOne Zip, etc.

Why is it running slow?

回答1:

64 bit will not always run faster.
The short answer is that 64 bit application consumes more memory (if you have an array of 64 bit pointers it will be larger than array of the same size with 32 bit pointers) More memory means that the garbage collection will work harder.
Read here and here for more details.

In any case you'll have to profile the application and see where's the bottle neck.
(maybe looking at the GC is a good place to start)