Search code examples
.netwinformsperformancex86anycpu

.Net2 assemblies hosted in .Net4 app perform better in x86 than in AnyCpu mode?


I have a .Net4 WinForms app that references 3rd party .Net2 assemblies, which contain graphics-heavy visual controls. I've noticed a huge improvement in app's visual performance when I accidentally switched it from AnyCpu to x86 compilation mode. My development rig is a x64 Windows 7. The improvement is by a factor of at least two when controls are rendering their graphical elements.

Is this a known fact or am I doing something wrong?


Solution

  • See these two articles about it:

    AnyCPU Exes are usually more trouble than they're worth

    Visual Studio: Why is there no 64 bit version? (yet)

    See also this post about 64-bit code: Should I choose to take advantage of 64-bit?, it clearly states that for example Paint.NET works better under in 64-bit mode, because the developer optimized the code for 64-bit.

    So, I don't think you are doing something wrong, but maybe the 3rd party .NET assemblies you're using could be improved specifically when running in a 64-bit process.