3
以下哪3个是ActionScript 3中AVM2上最快(最少的CPU周期)?在AS3中获取对象构造函数的最快方法是什么?
Object(instance).constructor
(instance as Object).constructor
instance["constructor"]
我会做一些测试,但我不知道如何正确配置文件之类的话。
以下哪3个是ActionScript 3中AVM2上最快(最少的CPU周期)?在AS3中获取对象构造函数的最快方法是什么?
Object(instance).constructor
(instance as Object).constructor
instance["constructor"]
我会做一些测试,但我不知道如何正确配置文件之类的话。
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
performancetests.Constructors (5 iterations, 5,000,000 loops through each)
Player version: MAC 10,0,32,18 (debug)
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
method...................................................ttl ms...avg ms
instanceAsObjectConstructor 9516 1903.20
instanceBracketConstructor 6941 1388.20
objectDotConstructor 9916 1983.20
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
这必须是因为instanceBracketConstructor是唯一不会投射实例的人。否则这个结果会吓到我。 – dlamblin 2009-10-04 22:41:21