性能编程 [英] Performance Programming

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

问题描述

大家好,


我只是为了性能从Java切换到C,但我不知道是否有任何可以提高性能的编码技术C?我问

这样一个开放式问题引起我的回应,如链接和

讨论。


由我也很头疼ArrayIndexOutOfBound

异常,其中C或C ++从不警告任何读取未初始化的内存,我可以在所有内存解除引用点处制作陷阱,这样我就可以检查这块内存是否有效,比如数组索引,还是选择

成员?无论如何这可以做到,除了通过诸如

Purify之类的工具来设置代码?


Andrew

Hi all,

I am switching from Java to C solely for performance, but I wonder are
there any coding techniques that can boost performance in C? I am asking
such an open-ended question to elicit response for me such as links and
discussion.

By the way, I am also pretty headache with ArrayIndexOutOfBound
exception, in which C or C++ never warn about anything reading uninitialized
memory, can I make a trap at all memory dereferencing point, so that I can
check if the piece of memory is valid, such as array indexing, or picking
member? Anyway this can be done except instrumenting code by tools such as
Purify?

Andrew

推荐答案

在文章< ch ********* @ imsp212.netvigator.com>,

" Andrew Au \(Newsgroup \)" <例如**** @ hotmail.com>写道:
In article <ch*********@imsp212.netvigator.com>,
"Andrew Au \(Newsgroup\)" <eg****@hotmail.com> wrote:
大家好,

我只是为了性能从Java切换到C,但我不知道是否有任何编码技术可以提高C的性能?我问这样一个开放式问题引起我的回应,如链接和讨论。
Hi all,

I am switching from Java to C solely for performance, but I wonder are
there any coding techniques that can boost performance in C? I am asking
such an open-ended question to elicit response for me such as links and
discussion.




这真的很聪明。你从Java切换到C以使程序更快,

但你不知道如何让它们更快?如果要在

comp.lang.java中询问提高Java性能的技术呢?



That''s really clever. You switch from Java to C to make programs faster,
but you have no idea how to make them faster? How about asking in
comp.lang.java for techniques that boost performance in Java?


因为C更接近机器语言,我可以通过利用机器相关的特性来增加

的性能,例如,使用SSE指令的
,...


I我不确定,所以我问。

Christian Bau < CH *********** @ cbau.freeserve.co.uk> | b?l¥ó

新闻:ch ********************************* @slb-newsm1.svr.pol.co.uk¤¤??? g ...
Because C is more close the machine language, I could possibly increase the
performance by exploiting machine dependent characteristics, for example,
using SSE instruction, ...

I am not sure about that, therefore I asked.
"Christian Bau" <ch***********@cbau.freeserve.co.uk> |b?l¥ó
news:ch*********************************@slb-newsm1.svr.pol.co.uk ¤¤???g...
文章< ch ********* @ imsp212.netvigator.com> ,
Andrew Au \(新闻组\) <例如**** @ hotmail.com>写道:
In article <ch*********@imsp212.netvigator.com>,
"Andrew Au \(Newsgroup\)" <eg****@hotmail.com> wrote:
大家好,

我只是为了性能而从Java切换到C,但我不知道
是否有任何编码技术可以提高C的性能?我问这样一个开放式问题引起我的回应,如链接和讨论。
Hi all,

I am switching from Java to C solely for performance, but I wonder are there any coding techniques that can boost performance in C? I am asking
such an open-ended question to elicit response for me such as links and
discussion.



这真的很聪明。您从Java切换到C以使程序更快,
但您不知道如何使它们更快?如何在
comp.lang.java中询问提高Java性能的技术?



That''s really clever. You switch from Java to C to make programs faster,
but you have no idea how to make them faster? How about asking in
comp.lang.java for techniques that boost performance in Java?



Andrew Au(新闻组)写道:
Andrew Au (Newsgroup) wrote:
因为C更接近机器语言,我可以通过利用机器相关特性来提高性能,例如,使用SSE指令,......
Because C is more close the machine language, I could possibly increase the
performance by exploiting machine dependent characteristics, for example,
using SSE instruction, ...




在你的情况下,我将学习C语言的基础知识,然后切换到C ++。或者甚至

只做C ++但是使用全部原始 ... er imperativ(:-))

语言属性C ++有,所以你可以用一些

加速机制编写干净的OO代码。

但是加速um代码的最佳方法是让它由你选择的

编译器完成。


亲切的问候,

Nicolas


PS但请注意,C ++就像C maschine一样依赖!



In your case I''d learn the Basics in C and then switch to C++. Or even
do only C++ but with the all "primitive" ... er imperativ ( :-) )
languageproperties C++ has, so you can write clean OO - code with some
speed up mechanism.
But the best measure to speed um code is to let it be done by the
compiler of your choice.

Kind regards,
Nicolas

P.S. But note, C++ is like C maschine - dependent!


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

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