On 2009-05-02, at 07:16EDT, André Bargull wrote:

+Instance.prototype.addProperties(['addProperty', function addProperty(name, value) {
+      this.addProperties(arguments);
+    }]);

It's more efficient to create an array here instead of using the arguments object. The array solution was about 20%-30% faster, tested with swf8, swf9, dhtml (FF3, Saf3, Opera9). You can verify with this simple testcase:

Interesting! I guess these script engines are just not optimized for these cases. I'm still living in the Lisp world where `arguments` would be a stack-allocated list, and only copied to the heap if you captured it in an upward funarg...

I've made your suggested change.  Thanks.

Reply via email to