更快,更小的C程序 [英] Faster and Smaller C Programm

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

问题描述

大家好,
现在我需要一些帮助.不,我没有代码无法正确运行或根本无法运行.现在,我想对您提出一个严肃的问题:<<<"如何使我的C程序运行得更快并且使用更少的内存?

如果您对此一无所知,请尽快告诉我.
感谢您的宝贵时间.

Hey guys,
now i need some help. No, i dont have a code that doesn''t run correctly or doesn''t run at all. Now i want to amke you a serious question: <<How can I make my C programm run faster and use less memory?>>

If you know anything about it, then plz tell me ASAP.
Thanks for your time.

推荐答案

阅读此内容

http://stackoverflow.com/questions/2555402/c-performance-memory-optimization-guidelines [^ ]
还有
http://leto.net/docs/C-optimization.php [
Read This

http://stackoverflow.com/questions/2555402/c-performance-memory-optimization-guidelines[^]
And
http://leto.net/docs/C-optimization.php[^]

And try to design function according to it.<</xml>


正如其他人已经指出的那样,应该同时优化代码的速度和内存.消费(这是一个令人吃惊的任务,通常在这两个需求之间要进行权衡).
手工工艺优化是一门艺术,您当前的态度(在 Quick Answer上发布ASAP请求)与之产生强烈冲突.
As others already pointed out, you should optimize your code both for speed and memory consumption (and it is a startling task, there is usually a trade-off between these two requirements).
Hand craft optimization is an art and your current attitude (posting an ASAP request at Quick Answer) strongly clashes with.


您要的是这些品质的结合:

1.良好的判断力(通常伴随经验)
2.对您使用的目标语言有充分的了解(通常是有经验的)
3.良好的基础教育(要求使用好书,而且经常要有好老师..也可以通过经验获得.)

最重要的是,这是您可以学习的东西,但是要擅长于此,需要时间和决心,并要采取正确的行动(从错误中学习)..这不能简化为网站上简单的两段式回答,否则您会一周学习.

真正擅长编程(就像擅长任何事情一样)非常耗时.它不是快餐.
What you are asking for is something that is a combination of these qualities:

1. good judgement (generally comes with experience)
2. good knowledge of the target language you are using (usually comes with experience)
3. good education in the basics (requires the use of good books, and frequently good teachers.. can also be gotten through experience).

Bottom line, this is something you can learn, but getting good at it requires time and commitment and correct action (learning from your mistakes).. its not something reducible to a simple 2 paragraph answer on a website, or something you''ll learn in a week.

Getting really good at programming, much like getting good at anything, is very time-intensive. Fast food it ain''t.


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

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