On 1/23/12 12:05 PM, "Ryan Frishberg" <fri...@gmail.com> wrote: > I understand that caching every function would be expensive, but I don't > understand why a reference to a function isn't just 4 bytes. Why is it a > closure? The only thing I can think of that would be in scope would be the > "this" object for the function owner (but maybe that's what makes it a > closure)? Believe me, I was surprised to find this out as well. Basically, it is because of an inefficient implementation in the VM. At minimum, it has to reference two things: the pointer to the 'this' object and the pointer to the name of the method, so I'm pretty sure it has to be at least 8 bytes, but when I asked about it a while back, they decided it couldn't be less than 32 bytes (yes, bytes not bits). Apparently there is other stuff that needs to be tracked as well. -- Alex Harui Flex SDK Team Adobe Systems, Inc. http://blogs.adobe.com/aharui
- Re: Flex 5 UIComponent - Behavior Pattern Doug McCune
- Re: Flex 5 UIComponent - Behavior Pattern Bogdan DINU
- Re: Flex 5 UIComponent - Behavior Pattern Doug McCune
- Re: Flex 5 UIComponent - Behavior Pattern Bogdan DINU
- Re: Flex 5 UIComponent - Behavior Patter... Omar Gonzalez
- Re: Flex 5 UIComponent - Behavior Patter... Alex Harui
- Re: Flex 5 UIComponent - Behavior Pattern Alex Harui
- Re: Flex 5 UIComponent - Behavior Pattern Doug McCune
- Re: Flex 5 UIComponent - Behavior Pattern Alex Harui
- Re: Flex 5 UIComponent - Behavior Patter... Ryan Frishberg
- Re: Flex 5 UIComponent - Behavior P... Alex Harui
- Re: Flex 5 UIComponent - Behavior Pattern Wael Jammal
- Re: Flex 5 UIComponent - Behavior Pattern Bogdan DINU
- Re: Flex 5 UIComponent - Behavior Pattern Jonathan Campos
- Re: Flex 5 UIComponent - Behavior Pattern Bogdan DINU
- Re: Flex 5 UIComponent - Behavior Pattern Tink
- Re: Flex 5 UIComponent - Behavior Pattern Bogdan DINU
- Re: Flex 5 UIComponent - Behavior Pattern Haykel BEN JEMIA
- Re: Flex 5 UIComponent - Behavior Pattern Alex Harui
- Re: Flex 5 UIComponent - Behavior Patter... Haykel BEN JEMIA
- Re: Flex 5 UIComponent - Behavior P... Alex Harui