Running a 32-bit .NET application on a 64-bit OS, is it really bad?

I understand that we can compile a .NET application by configuring AnyCPU on it, which will launch the 32-bit version on a 32-bit OS and 64-bit on a 64-bit OS.

However, there was a registered error * on a 64-bit OS, which my application generated an error, and to solve this problem I need to configure x86.

Now my question is: is it really bad to focus on x86, even if your code works in x64? What kind of performance are we talking about? (my application works quite intensively with the processor, but it is very difficult to find)

After the .NET Framework starts on a 32-bit basis, which sounds bad to me, not the full addressing power of the x64 processor **.

* I don’t remember the error, but the solution was specifically designed for x86 and solved the problem.

** I'm not sure if this is important, but my application does not use Int64 variables.

+6
performance 64bit
source share
9 answers

No, that's not bad; In fact, for the application I'm working on, I need to target x86 (since it brings in COM objects for which the provider does not support x64)

+4
source share

I had a lot of crunchy applications that often used the CPU (roughly forcing some kind of solution). Running on the 64-bit .NET Framework (8 seconds) was about 4 times faster than 32 bits (30 seconds). This is just one case.

+2
source share

No, this is not so bad if you need to configure x86 on x64 systems. You will miss the added benefits of x64 and end up at the 32-bit emulation level. But this is better than being completely broken, and most applications there are still 32bit.

With .Net, the usual reason for this is a dependency on the native 32-bit dll only. If you leave your .Net from any processor, it will try to load your 32-bit dll in 64-bit mode, which will crash. Ultimately, you want to move away from this dependency so that you can use 64-bit mode. But for one issue, he will not kill you.

+1
source share

Answer: "It depends." It depends on what your application does, regardless of whether it accesses memory a lot or not. Kevin is right: the processor has to transport a lot of addresses, but this probably will not hurt the performance of your application. The basic hardware instructions basically coincide between x86 and amd64, and there is not much inefficiency if the CLR authors knew what they were doing (and I'm sure they did). You can see a big difference in performance if you do graphics, but since this is just a .NET application, I don’t think so. For some crunchy tasks, you can notice the difference that Mehrdad talked about, although I would be surprised if you did.

In general, I would say that you should not worry about performance problems if you do not have an application with a high sensitivity to performance. Then just worry about performance issues as soon as you understand the nature of your application.

+1
source share

If you use structure extraction and have a lot of 64-bit computing (double, long), you will see a decrease in performance due to the fact that the 32-bit Jit engine is less advanced compared to the 64-bit one.

Otherwise, the 32-bit and 64-bit versions of .Net are somewhat similar in performance.

And also, if you do not need to exceed the 2 GB limit for your process, you do not need 64-bit for the possibility of addressing, the OS will take care of this using a special CPU mode called Long Mode - SubMode compatibility. (The processor actually operates in 64-bit mode, but uses 32-bit for addressing, for compatibility)

+1
source share

What you need to remember is that in order to start a 32-bit process in a 64-bit environment, the system must perform a memory address translation for everything that it does. This is bad? It depends on the scenario. It is definitely not as effective as it could be. Running a 32-bit IIS interface on an x-64 server is painfully slow compared to what it can be. It all depends on your application needs.

0
source share

Not. It will work without problems. In fact, we often found that our 32-bit applications run better on 64-bit Vista than on 32-bit Vista, due to the newer OS memory manager. The x86 target directly should work fine. Nevertheless, the ability to run initially at the 64-bit level will have other advantages, such as the ability to access more memory, more registers for the processor, etc., Therefore, it is worth making an effort to get started and work, if it perhaps.

0
source share

I was going to say that the best way to say for sure is to measure, but obviously if it does not work properly, it is difficult to measure.

First of all, see if there are performance issues. If this seems like a problem, then see if you can determine exactly what is in the application that is not compatible with x64. Most .NET codes must be platform independent, so any native interactive or third-party libraries may be the most likely culprit.

0
source share

Did you have a β€œmistake” in your .NET code using a 32-bit COM object?

This case can really be a problem when starting the .NET process in a 64-bit architecture that was compiled with the AnyCPU configuration.

The reason is that the process will be executed as a 64-bit process, and any COM component that will be launched in the process must also be a 64-bit version. If this is not the case, your process will end.

A possible solution is to install the target platform on x86.

0
source share

All Articles