编译器的渐近复杂度
通用编译器可接受的最大渐近运行时间是多少?
澄清一下:编译过程本身的复杂性,而不是编译后的程序的复杂性。取决于程序大小,例如源代码字符、语句、变量、过程、基本块、中间语言指令、汇编指令等的数量。
这很大程度上取决于您的观点,因此这是一个社区维基。
从编写编译器的人的角度来看这一点。当其中一项优化需要 O(n^6) 时,优化级别 -O4
是否会用于较大的程序?
相关问题:
什么时候可以接受超级优化(指数复杂度甚至无法计算)?
JIT 可以接受什么?它必须是线性的吗?
现有编译器的复杂性是多少?海湾合作委员会?风险投资?英特尔?爪哇? C#?涡轮帕斯卡?低成本航司? LLVM? (参考?)
如果你不知道渐近复杂性是什么:你愿意花多长时间等到编译器编译你的项目? (不包括脚本语言)
What is the maximal acceptable asymptotic runtime of a general-purpose compiler?
For clarification: The complexity of compilation process itself, not of the compiled program. Depending on the program size, for instance, the number of source code characters, statements, variables, procedures, basic blocks, intermediate language instructions, assembler instructions, or whatever.
This is highly depending on your point of view, so this is a community wiki.
See this from the view of someone who writes a compiler. Will the optimisation level -O4
ever be used for larger programs when one of its optimisations takes O(n^6)?
Related questions:
When is superoptimisation (exponential complexity or even incomputable) acceptable?
What is acceptable for JITs? Does it have to be linear?
What is the complexity of established compilers? GCC? VC? Intel? Java? C#? Turbo Pascal? LCC? LLVM? (Reference?)
If you do not know what asymptotic complexity is: How long are you willing to wait until the compiler compiled your project? (scripting languages excluded)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您不会发现任何大型项目需要对每个源文件进行最高级别的优化。我希望这种优化级别仅针对那些真正需要它的文件/类/模块。因此,为开发人员提供方法来限制需要优化的代码的范围和成本非常重要。
I don't think you will find any large project that requires the highest level of optimization for every source file. I would expect that level of optimization to only on those files/classes/modules that really need it. So it is important to provide ways for the developer to limit the scope and cost of such optimizations to the code that needs it.