简体   繁体   English

C ++ 0x优化编译器质量

[英]C++0x optimizing compiler quality

I do some heavy numbercrunching and for me floating-point performance is very important. 我做了一些沉重的数字处理,对我来说浮点性能非常重要。 I like performance of Intel compiler very much and quite content with quality of assembly it produces. 我非常喜欢英特尔编译器的性能,并且它对产生的组件质量非常满意。

I am thinking at some point to try C++0x mainly for sugar parts, like auto , initializer list, etc, but also lambdas. 我想在某些方面尝试C ++ 0x主要用于糖部分,如auto ,初始化列表等,还有lambdas。 at this point I use those features in regular C++ by the means of boost. 在这一点上,我通过boost在常规C ++中使用这些功能。

How good of assembly code do compilers C++0x generate? 编译器C ++ 0x生成的汇编代码有多好? specifically Intel and gcc compilers. 特别是英特尔和gcc编译器。 Do they produce SSE code? 他们生产SSE代码吗? is performance comparable to C++? 性能是否与C ++相当? are there any benchmarks? 有没有基准?

My Google search did not reveal much. 我的谷歌搜索没有透露太多。

Thank you. 谢谢。

ps: at some point am going to test it myself but would like to know what to expect relative to C++. ps:在某些时候我将自己测试它,但想知道相对于C ++会发生什么。

You can expect the same optimization for your code, because the compiler certainly didn't get worse at optimizing. 您可以期望对代码进行相同的优化,因为编译器在优化时肯定没有变得更糟。 So only using the new C++0x features might impact it. 因此,仅使用新的C ++ 0x功能可能会对其产生影响。 But I doubt your core routines would suddenly be completely changed to somehow use C++0x-only features. 但我怀疑你的核心例程会突然完全改变,以某种方式使用C ++ 0x-only功能。

Keep in mind things like auto and lambda are just syntactic sugar. 请记住像auto和lambda这样的东西只是语法糖。 That will have no effect on compiler optimization because they're just methods of generating the same code you would anyway. 这对编译器优化没有影响,因为它们只是生成相同代码的方法。 So you'd only need to worry about the new "stuff" like initializer lists. 所以你只需要担心初始化列表之类的新“东西”。 But I'd be surprised if that was inefficient as well. 但如果这也是低效的话,我会感到惊讶。

You should also expect many improvements, because of move-semantics. 由于移动语义,您还应该期待许多改进。 No longer must you copy data around but merely move it around. 您不再需要复制数据,而只是移动数据。 Design your code to take advantage of this for most benefit. 设计您的代码以充分利用这一优势。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM