.Net 2.0 与 .Net 3.5 的性能比较
微软声称.Net 3.5框架比2.0有许多速度改进。 有人能够证实这一说法吗?
我对计算类型的东西(数学、图形等)特别感兴趣,但也更普遍?
Microsoft claims that the .Net 3.5 framework has many speed improvements over 2.0. Is anyone able to verify this claim?
I am especially interested in computational type stuff (math, graphics, etc), but also more generally?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
对于某些任务,3.5 CLR 似乎确实更快。
下面是 2.0 与 3.5 上排序差异的相当简单的比较,显示了 .Net 3.5 中相当大的性能改进。
http://systematicgaming.wordpress.com /2009/01/13/performance-c-vs-c-part-2/
到底是什么导致了这些改进还不清楚,但是结构在 2.0 下处理得不好,而内联在 3.5 中得到了改进,两者都可以在适当的情况下会产生很大的影响。
The 3.5 CLR does seem to be faster for certain tasks.
Here's a fairly simple comparison of sorting differences on 2.0 vs 3.5, showing decent performance improvements in .Net 3.5.
http://systematicgaming.wordpress.com/2009/01/13/performance-c-vs-c-part-2/
What exactly caused the improvements is unclear, but structs were not well handled under 2.0 and inlining has improved in 3.5, both of which can make a big difference under the right circumstances.
我听说 3.5 JIT 比 2.0 更智能地内联函数和命令,这确实可以帮助内存交换。
如果您对版本之间的具体时间感到好奇,您可能需要使用(许多).NET 探查器之一自行测试。 它们对于测量每个函数的 CPU 时间和垃圾收集器中的内存交换非常有用。
CLR 探查器:http:// /www.microsoft.com/Downloads/details.aspx?FamilyID=86ce6052-d7f4-4aeb-9b7a-94635beebdda&displaylang=en
dotTrace(非常好,但付费;10 天试用):http://www.jetbrains.com/profiler/
I've heard that the 3.5 JIT inlines functions and commands more intelligently than 2.0 which can really help memory swaping.
If you're curious about specific timings between versions you might want to test it out yourself with one of the (many) .NET Profilers. They're really useful to measure CPU time per-function and memory swaping in the garbage collector.
CLR Profiler: http://www.microsoft.com/Downloads/details.aspx?FamilyID=86ce6052-d7f4-4aeb-9b7a-94635beebdda&displaylang=en
dotTrace (really good but paid; 10 day trial): http://www.jetbrains.com/profiler/
如果不彻底修改仍然基于 2.0 的 CLR,核心计算功能似乎不太可能出现任何重大性能改进。 然而,我读到的报告称 3.5 SP1 极大地缩短了应用程序的启动时间(更多的是关于资源分配和初始化而不是计算速度)。
Seems unlikely core computational functions would see any major performance improvement without an overhaul of the CLR, which is still based on 2.0. However, I have read reports that 3.5 SP1 drastically improves application startup time (more about resource allocation and initialization than computational speed).
我知道生成线程实际上已经减慢了。 生成的线程越多,延迟就越长。 除了我没有注意到任何问题。
I know spawning threads have actually slowed down. The more threads you spawn the longer the delay. Aside from the I haven't noticed any issues.
3.5 还添加了 2.0 SP1,它取代了 JITter,并且 x86 平台获得了能够在值类型上内联函数的好处,因此像 Double.Compare(Double) 这样的方法会被内联。 如果您的代码对此敏感(主要是数字运算),您将在运行时看到很好的加速。
3.5 also adds 2.0 SP1 which replaces the JITter and the x86 platform picks up the benefit of being able to inline functions on value types, so methods like Double.Compare(Double) get inlined. If you have code which is sensitive to this (mostly number crunching), you'll see a nice speedup at runtime.