我们必须使用C"性能方面的原因" [英] We have to use C "for performance reasons"

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

问题描述

在这个年龄段的许多语言的存在似乎是几乎每一个任务一个伟大的语言,我发现自己的专业对抗的口头禅挣扎不过C是快',其中快速真的指不够快。我喜欢谁比较数字很理性开放的态度人们的工作和我所拥有的是思想和意见。你能帮我找到我的路过去的主观意见,进入现实世界?

In this age of many languages there seems to be a great language for just about every task and I find myself professionally struggling against a mantra of 'nothing but C is fast' where fast is really intended to mean 'fast enough'. I work with very rational open minded people who like comparing numbers and all I have is thoughts and opinion. Could you help me find my way past subjective opinions and into the "real world"?

你能帮我找到的研究,以什么样是否为嵌入式可以使用任何其他语言和(Linux)的系统编程?我很可能会推着虚假的假设,将大大AP preciate研究显示此信息。能否请您链接或包括良好的数字,以帮助保持那只是他/她的意见的意见到最低限度:)

Would you help me find research as to what if any other languages could be used for embedded and (Linux) systems programming? I very well could be pushing a false hypothesis and would greatly appreciate research to show me this. Could you please link or include good numbers so as to help keep the "that's just his/her opinion" comments to a minimum :)

编辑:


  • 内存是不是一个严重的制约

  • 便携性是不是一个严重的问题

  • 这是不是一个实时系统

推荐答案

没有什么,但C是快[足够]是早期的优化是错误的所有原因的早期优化和错误的。如果你的系统有足够的复杂性C以外的东西是可取的,那么就会出现系统的组成部分必须是不够快和部件较轻的约束。如果用Python写的code(例如)将获得该项目完成更快,更少的错误,那么你可以用一些C语言或汇编code,以加快时间关键零部件跟进。

"Nothing but C is fast [enough]" is an early optimisation and wrong for all the reasons that early optimisations are wrong. If your system has enough complexity that something other than C is desirable, then there will be parts of the system that must be "fast enough" and parts with lighter constraints. If writing your code in Python (for example) will get the project finished faster, with fewer bugs, then you can follow up with some C or assembly code to speed up the time-critical parts.

即使事实证明,整个code必须在C语言或汇编编写,以满足性能要求,在原型Python等语言可以有实实在在的好处。你可以把你的工作的Python原型,并逐步取代用C code部分,直到达到所需的性能。

Even if it turns out that the entire code must be written in C or assembly to meet the performance requirements, prototyping in a language like Python can have real benefits. You can take your working Python prototype and gradually replace parts with C code until you reach the necessary performance.

所以,使用您获得开发工作最做得正确,最快速,然后用真实的数据来判断,你需要优化的工具。这可能是C是最合适的工具开始与有时,但肯定不是总是,即使在嵌入式系统中。

So, use the tools that let you get the development work done most correctly and most quickly, then use real data to determine where you need to optimize. It could be that C is the most appropriate tool to start with sometimes, but certainly not always, even in embedded systems.

这篇关于我们必须使用C"性能方面的原因"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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