[AS3] for/for in/for each,which one is faster?
2012-06-19 16:09
471 查看
"""
regular
Also, as with AS2 days, decrementing your way through a
But really, any slight difference here will be dwarfed by the requirements of what you actually do inside the loop. You can find operations that will work faster or slower in either case. The real answer is that neither kind of loop can be meaningfully said to be faster than the other - you must profile your code as it appears in your application.
"""
regular
"for"loops are moderately faster than
for eachloops in the minimal case.
Also, as with AS2 days, decrementing your way through a
forloop generally provides a very minor improvement.
But really, any slight difference here will be dwarfed by the requirements of what you actually do inside the loop. You can find operations that will work faster or slower in either case. The real answer is that neither kind of loop can be meaningfully said to be faster than the other - you must profile your code as it appears in your application.
"""
相关文章推荐
- Which one is better for simulating wireless sensor network (WSN)? omnet++ or Ns-2 Ns-3
- qt 错误:request for member 'show' in 'showlist_ui', which is of non-class type 'ShowList*'
- Which one is the faster one, innerHTML or DOM?
- Question 12: In C++, which of the following is the best declaration for an overloaded operator[] to allow read-only access (and
- VS代码段扩展Snippet Designer is a Visual Studio plug in which allows you to create and search for snippets inside the IDE
- 323. Nothing in the world is difficult for one who sets his mind to it. 世上无难事,只怕有心人
- AS3 中的 for each in
- [Question]:Is there only one Servlet Inatance in each web application of web container
- as3中for in 和 for each in的区别
- 浅谈AS3 中的for,for in ,for each in的效率问题
- java.lang.IllegalStateException: The remote endpoint was in state [TEXT_FULL_WRITING] which is an invalid state for called method 解决办法
- error: request for member '*' in '*', which is of non-class type '*'
- Which one is the last archivelog we need for recover?
- error: request for member ‘***’ in ‘***’, which is of non-class type ‘***’
- How to know one virtual machine is in which host?
- At least one valid code-source or import-shared-library element is required for shared-library "global.libraries" in /embedded-
- 解决declares a dependency from configuration 'compile' to configuration 'default' which is not declared in the descriptor for project :kdps-common.
- Class JavaLaunchHelper is implemented in both. One of the two will be used. Which one is undefined
- iOS:Class Foo is implemented in both MyApp and OtherApp. One of the two will be used. Which one is u
- request for member 'getid’ in ‘e1’, which is of non-class type ‘Employee()’