ActionScript 2 vs ActionScript 3 performance

天涯浪子 提交于 2019-12-24 00:47:34

问题


Any benchmarks of Integer, Array, Function, Class, etc, performance in these 2 languages (compilers)?

Comparisons would also be helpful.


回答1:


Since AS3 runs in a different virtual machine (AVM2) than AS2 (AVM) there have been made significant performance improvements with the introduction of AS3. In general, opcode executed by AVM2 runs about 10x faster than similar opcode running in the old AVM. This of course does not mean that everything in AS3 is 10x times faster than with AS2. With the introduction of AS3 all the display functions, or all the typical Flash API's, haven't increased in speed only the logic and arithmetic part of the code execution process. E.g. applying a blur filter on a visual element is just as fast with AS2 as it is with AS3 however, doing 3D transformations is much faster with AS3. AS3 introduces also some new data types which can increase performance as well (all though that doesn't necessarily always be the case).

Here are some links with information about AS3 performance:

  • Avoid ints in AS3
  • Types in AS3
  • AS3 Performance Tests
  • Flash AS3 and AVM2: Performance Tuning



回答2:


i think you have to be more specific in what exactly are you looking for, i doubt anyone benchmarked and compared everything. also, AS is only the language, but there are speed differences between player versions, platform and browsers too.

but as a general rule, AS3 is almost always faster, sometimes with orders of magnitude.



来源:https://stackoverflow.com/questions/453391/actionscript-2-vs-actionscript-3-performance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!