各种.NET版本中的CLI/C ++性能 [英] CLI/C++ Performance in various .NET versions

查看:111
本文介绍了各种.NET版本中的CLI/C ++性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以您的经验,在不同版本的.NET运行时中使用CLI/C ++时,性能是否会有差异?最近,我们已将应用程序升级到.NET 4.0,并且我们认为该层的性能受到了负面影响.

In your experience, are there any performance differences when using CLI/C++ across different versions of the .NET runtimes? Recently we have upgraded an application to .NET 4.0 and we believe the performance of this layer has been negatively effected. Are there some patterns of programming this stack that are less performant than others?

推荐答案

我没有(出于实用的目的,尽可能接近零;))关于CLI/C ++语言的经验,但是当我们六年前从.NET 1.1迁移到.NET 2.0时,我可以证实这种情况的发生.涉及到一些缓存的DataTable,在.NET 1.1中,所有内容都像个魅力一样.迁移到.NET 2.0之后,使用DataTable的相关代码部分似乎正在以蜗牛般的速度爬行.修复非常容易,尽管并不容易找到:我们从DataTable s切换到了DataView s,并且一切都像以前一样迅速.

在那之前,那肯定是最大的WTF情况之一.从那时起,在很多情况下新代码破裂或negativley影响性能.因此,从我的角度来看,这更像是框架工作,而不是语言本身.

干杯周末愉快,

Manfred
I''ve no (well for practical purposes as near to zero as one can get ;)) experience regarding the language CLI/C++, but I can confirm this happening when we moved from .NET 1.1 to .NET 2.0 six years ago. There were some cached DataTables involved and in .NET 1.1 everything worked like a charm. After the move to .NET 2.0 the relevant code parts using the DataTables seemed to be crawling along at snails pace. The fix was quite easy, albeit not readily found: We switched from DataTables to DataViews and all was swift as before.

That must have been one the greatest WTF situations until then. Since that time there have been numerous occasions where new code broke or negativley affected performance. So from my standpoint it was more a Framwork thing and not the language in itself.

Cheers & have a nice weekend,

Manfred


首先,您必须验证执行了哪些安全检查.通常,在调试版本中,STL或STL/CLI的性能相对较差,因为需要进行大量的验证.

当应用程序在调试器下运行时,该问题也主要发生.

在发行版(和独立运行的应用程序)中,性能通常是足够的.

升级到.NET 4.0之后,我从未注意到任何减少的情况.

在混合模式应用程序中(和在调试中),. Net容器通常比STL更快.我认为这主要与验证迭代器之类的所有额外验证有关.
First you have to verify what security checks are performed. Generally, the performance of STL or STL/CLI is relatively bad in debug version as a lot of validation is done.

That problem also mainly occurs when the application is run under the debugger.

In Release version (and the application running stand-alone), generally the performance is quite adequate.

I have never noticed any decreasing after upgrading to .NET 4.0.

In mixed-mode application (and in debug), .Net container are generally faster than STL one. I think it mainly related to all extra validation that is done to validate iterator and such.


另请参阅此讨论
http://journal.stuffwithstuff.com/2009/01/03/debunking -c-vs-c-performance/ [ http://stackoverflow.com/questions/686483/c-sharp-vs- c-big-performance-difference [ ^ ]
CP文章
头对头基准测试:C ++与.NET [ ^ ]

谢谢
--RA
See this Discussion also
http://journal.stuffwithstuff.com/2009/01/03/debunking-c-vs-c-performance/[^]
http://stackoverflow.com/questions/686483/c-sharp-vs-c-big-performance-difference[^]
CP article
Head-to-head benchmark: C++ vs .NET[^]

Thanks
--RA


这篇关于各种.NET版本中的CLI/C ++性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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