64 位 .NET 性能调优 [英] 64bit .NET Performance tuning

查看:28
本文介绍了64 位 .NET 性能调优的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 .NET 是在应用程序运行之前将 JIT 编译为您正在运行的架构,但是 JIT 编译器是否完全针对 64 位架构进行了优化?

I know that .NET is JIT compiled to the architecture you are running on just before the app runs, but does the JIT compiler optimize for 64bit architecture at all?

在编写将在 64 位系统 上运行的应用程序时,是否需要完成或考虑任何事项?(即使用 Int64 会提高性能吗,JIT 编译器会自动使 Int64 在 32 位系统上工作吗?)

Is there anything that needs to be done or considered when programming an app that will run on a 64bit system? (i.e. Will using Int64 improve performance and will the JIT compiler automatically make Int64 work on 32bit systems?)

推荐答案

64 位 JIT 与 32 位的 JIT 不同,所以我预计输出会有一些差异 - 但我不会为此切换到 64 位,我也不希望获得太多速度(如果有)在 CPU 时间切换到 64 位.

The 64bit JIT is different from the one for 32bit, so I would expect some differences in the output - but I wouldn't switch to 64bit just for that, and I wouldn't expect to gain much speed (if any) in CPU time by switching to 64bit.

如果您的应用程序使用大量内存并且 PC 有足够的 RAM 来跟上它,您会注意到性能的显着提升.我发现 32 位 .NET 应用程序在使用到 1.6GB 左右时往往会开始抛出内存不足异常,但由于 分页 早在此之前 - 所以你最终会受到 I/O 限制.

You will notice a big performance improvement if your app uses a lot of memory and the PC has enough RAM to keep up with it. I've found that 32bit .NET apps tend to start throwing out of memory exceptions when you get to around 1.6gb in use, but they start to thrash the disk due to paging long before that - so you end being I/O bound.

基本上,如果你的瓶颈是 CPU,那么 64 位不太可能有帮助.如果您的瓶颈是内存,那么您应该会看到很大的改进.

Basically, if you're bottleneck is CPU then 64bit is unlikely to help. If your bottleneck is is memory then you should see a big improvement.

使用 Int64 是否会提高性能,JIT 编译器是否会自动使 Int64 在 32 位系统上工作

Will using Int64 improve performance and will the JIT compiler automatically make Int64 work on 32bit systems

Int64 已经可以在 32 位和 64 位系统上运行,但在 64 位上运行会更快.因此,如果您主要使用 Int64 进行数字运算,那么在 64 位系统上运行应该会有所帮助.

Int64 already works on both 32bit and 64bit systems, but it'll be faster running on 64bit. So if you're mostly number crunching with Int64, running on a 64bit system should help.

最重要的是衡量你的表现.

这篇关于64 位 .NET 性能调优的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆