title: AS3 object memory usage with static vs. instance methods
body: <p>This has been a long-standing curiosity of mine, and I haven't gotten around to profiling to find out, and haven't seen it asked yet (for AS3):</p>
  
  <p>Let's say that I have a class:</p>
  
  <pre><code>class MyClass {
     public function myMethod():String {
         return "some return value";
     }
  }
  </code></pre>
  
  <p>which will be instantiated a lot of times:</p>
  
  <pre><code>for (var i:Number = 0; i &lt; 10000; i++) {
     var myObject:MyClass = new MyClass();
     trace(myObject.myMethod);
  }
  </code></pre>
  
  <p>Will changing <code>myMethod</code> to static have any change on the memory footprint of my app?</p>
  
  <p>Is mxmlc smart enough to make a single reference to the function?</p>
  
  <p>Basically, if I keep my method non-static will there be:</p>
  
  <ol>
  <li>No difference from a static version the method as far as memory is concerned</li>
  <li>10,000 small instance references to a single function</li>
  <li>10,000 function bytecode duplicates</li>
  </ol>
  
  <p>in memory?</p>