既然我习惯于在非常内存约束条件下进行编程,那么我没有答案的一个问题是:哪个内存效率更高; - (;;)还是while()? 或者它们是否可以互换? 如果有的话,还要评论效率问题!
Now that I am used to programming in very memory constraint conditions, one question which I dont have an answer is : Which is more memory efficient;- for(;;) or while() ? Or are they interchangeable equally? Also comment on efficiency matters if any!
最满意答案
编程语言结构和while之间的内存使用没有区别。 给定的编译器可能会更好地优化其中一个,但您不必担心这一点。 有了内存约束条件,最重要的将是你的数据结构和系统设计。 糟糕的系统设计可能需要更多的内存。
There is no difference in memory use between the programming language construct for and while. A given compiler might optimize one or the other better but you should not worry about this. With memory constraint conditions the most important thing is going to be your data structures and system design. A poor system design could require more memory.
而循环与For循环,这是更高的内存效率!(While Loop vs For Loop, which is more memory efficient!)既然我习惯于在非常内存约束条件下进行编程,那么我没有答案的一个问题是:哪个内存效率更高; - (;;)还是while()? 或者它们是否可以互换? 如果有的话,还要评论效率问题!
Now that I am used to programming in very memory constraint conditions, one question which I dont have an answer is : Which is more memory efficient;- for(;;) or while() ? Or are they interchangeable equally? Also comment on efficiency matters if any!
最满意答案
编程语言结构和while之间的内存使用没有区别。 给定的编译器可能会更好地优化其中一个,但您不必担心这一点。 有了内存约束条件,最重要的将是你的数据结构和系统设计。 糟糕的系统设计可能需要更多的内存。
There is no difference in memory use between the programming language construct for and while. A given compiler might optimize one or the other better but you should not worry about this. With memory constraint conditions the most important thing is going to be your data structures and system design. A poor system design could require more memory.
发布评论