性能 [英] performance

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

问题描述

Willy Denoyette [MVP]写道;

......它不是StrousTrup的意图,以达到C的效率水平他发明了C ++,...




Ahmmm。我的目标是与C和我的表现相匹配,实现

很早就瞄准了。参见,例如The Design and Evolution of C ++。


- Bjarne Stroustrup; http://www.research.att.com/~bs

解决方案

" bjarne" < BJ **** @ gmail.com>在消息中写道

news:11 ********************** @ z14g2000cwz.googlegr oups.com ...

啊。我的目标是与C和我的表现相匹配,这很快就达到了目的。参见,例如The Design and Evolution of C ++。

- Bjarne Stroustrup; http://www.research.att.com/~bs




嗨Bjarne,我怀疑这是人们对某些编译器的经验

导致他们认为C ++无法与之竞争C.我经常发现开发人员优化的愿望是错误的,特别是当'b $ b'概念'足够快​​'时。


-

问候,


Tim Haughton


Agitek
http://agitek.co.uk
http://blogitek.com/timhaughton




" bjarne" < BJ **** @ gmail.com>在消息中写道

news:11 ********************** @ z14g2000cwz.googlegr oups.com ...

Willy Denoyette [MVP]写道;

......它不是StrousTrup的意图,以达到效率水平



啊。我的目标是与C和我的表现相匹配,这很快就达到了目的。参见,例如The Design and Evolution of C ++。

- Bjarne Stroustrup; http://www.research.att.com/~bs




Hmm .." match"这句话说的很多,但它并没有说相同的

表现,请注意Hejlsberg,可能会使用相同的措辞

谈论C#的设计和演变 ;-)


你可以写等效在C语言中使用C ++作为性能的代码,但是一旦你开始使用C ++习语,你就会失去

的性能(这不是说效率)?如果你真的是Bjarne,

你肯定比其他人更了解这个并且你不会在这里发帖

:-)。

C ++代码,这里我指的是使用C ++ OO习语的程序,比如类,

继承,封装,异常安全等等表现较差(不是那么多b $ b)比起纯粹的C,这些特征是有代价的,但这并不意味着b $ b意味着语言不那么有效。作为一个整体 - 非常反对monchère,

你只是在性能方面略微提高了效率,而且我们不应该这样做b
$ b关心(我为一个人,我不),而是看看你赢得了什么


如果您不需要或不能或者可能不会使用这些OO成语和

语言功能或者你需要在每个周期保存(想想设备

驱动程序和一些高性能内核函数),你会有要降价,接近机器级别,即转到C(更高级别的机器

代码)或汇编语言。

Willy。




Tim Haughton写道:

" bjarne" < BJ **** @ gmail.com>在消息中写道
新闻:11 ********************** @ z14g2000cwz.googlegr oups.com ...

Ahmmm。我的目标是与C和我的表现相匹配,这很快就达到了目的。参见,例如The Design and Evolution of C ++。

- Bjarne Stroustrup; http://www.research.att.com/~bs <嗨Bjarne,我怀疑人们对某些编译器的体验导致他们认为C ++无法与C竞争。




我从未见过C / C ++编译器系统(例如GNU,Microsoft ...)

其中C ++编译器并不等于C编译器中的代码br />
公共子集。声称显示相反情况的大多数示例都可以跟踪非语言因素,例如动态与静态链接
标准库的b $ b或默认优化选项的差异。

我经常发现开发人员对优化的渴望是错误的,特别是在足够快的概念时。


这当然很重要。然而,性能可能很重要,然后问题就变成了如何找到适合优化的东西(例如

算法)而不是盲目地填充语言特征。 />
-
问候,

Tim Haughton

Agitek
http://agitek.co.uk
http://blogitek.com/timhaughton




Willy Denoyette [MVP] wrote;

... it
was not the intention of StrousTrup to the achieve the level of efficiency
of C when he invented C++, ...



Ahmmm. It was my aim to match the performance of C and I achieved that
aim very early on. See, for example "The Design and Evolution of C++".

-- Bjarne Stroustrup; http://www.research.att.com/~bs

解决方案

"bjarne" <bj****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

Ahmmm. It was my aim to match the performance of C and I achieved that
aim very early on. See, for example "The Design and Evolution of C++".

-- Bjarne Stroustrup; http://www.research.att.com/~bs



Hi Bjarne, I suspect it is people''s experience with certain compilers that
leads them into thinking C++ can''t compete with C. Often I find that a
developer''s desire to optimise is misguided, particularly when there''s a
notion of ''fast enough''.

--
Regards,

Tim Haughton

Agitek
http://agitek.co.uk
http://blogitek.com/timhaughton



"bjarne" <bj****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

Willy Denoyette [MVP] wrote;

... it
was not the intention of StrousTrup to the achieve the level of
efficiency
of C when he invented C++, ...



Ahmmm. It was my aim to match the performance of C and I achieved that
aim very early on. See, for example "The Design and Evolution of C++".

-- Bjarne Stroustrup; http://www.research.att.com/~bs



Hmm.. "match" is a word that say''s a lot, but it doesn''t say "the same"
performance, note that Hejlsberg, would probably use the same wording when
talking about "The design and Evolution of C#" ;-)

You can write "equal efficient" code in terms of performance using C++ as
you would in C, but once you start using C++ idioms you are loosing on
performance (this is not saying on efficiency)? if you really are Bjarne,
you sure know this better than anyone else and you won''t be posting here
:-).
C++ code, and here I mean programs making use of C++ OO idioms like classes,
inheritance, encapsulation, exception safety etc. are less performing (not
that much) than pure C, these ''features'' come at a cost, but that doesn''t
mean the language is less "efficient" as a whole - au contraire mon chère,
you just loose a tiny bit on efficiency in terms of performance, and it''s
that bit we shouldn''t care about (I for one I don''t), instead look at what
you won.
In cases that you don''t need or can''t or may not use these OO idioms and
language features or you need to save on every cycle ( think about device
drivers and some high performance kernel function), you will have to go
down, closer to the machine level, that is go to C (a higher level machine
code) or assembly language.
Willy.



Tim Haughton wrote:

"bjarne" <bj****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

Ahmmm. It was my aim to match the performance of C and I achieved that
aim very early on. See, for example "The Design and Evolution of C++".

-- Bjarne Stroustrup; http://www.research.att.com/~bs

Hi Bjarne, I suspect it is people''s experience with certain compilers that
leads them into thinking C++ can''t compete with C.



I have never seen a C/C++ compiler system (e.g. GNU, Microsoftm ...)
where the C++ compiler didn''t equal the C compiler for code in the
common subset. Most examples that claim to show the opposite can be
tracked down to non-language factors such as dynamic vs. static linking
of standard libraries or differences in default optimization options.
Often I find that a
developer''s desire to optimise is misguided, particularly when there''s a
notion of ''fast enough''.
That certainly matters a lot. Performance can be important, though, and
then the issue becomes how to find appropriate things to optimize (e.g.
algorithms) as opposed to blindly filliding with language features.
--
Regards,

Tim Haughton

Agitek
http://agitek.co.uk
http://blogitek.com/timhaughton




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

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