AS3 object reference/pointer cost

How much does a reference/pointer to an object cost in terms of memory and performance in Actionscript 3? Are weak references( using Dictionary object) less, the same or more overhead?

Answers


References are nothing more than the address to an object that is located on the heap. I guess it depends on the address range as to how many byte/s are needed. In anycase, it is going to be really really small, either a dword for 32bit machines or a qword for 64bit. You might as well think of them as insignificant and don't worry at all about how much space they take up.

With performance, the only thing you need to worry about is when you access a static variable in another class, there are some extra lookups required which slows performance a little (but a static variable in the same class as where you are calling is the same - from what I have read).

My educated guess is that weak references are the same regarding overhead, and even if they were not, it would be a microscopic difference.

If you are interested in reading more about the dark depths of the AVM2 then this is a pretty good read http://learn.adobe.com/wiki/display/AVM2/1.+Introduction

Hope that helps


Need Your Help

VBA table columns/rows converting and changing currency

vba

I have got an assignment in VBA where I have to convert an existing table's rows to colums, but I only have to show two rows from the table and all that has to be done with the help of an ActiveX c...

Can Active Pivot dimension/measure field names or aliases contain spaces?

activepivot

A search of the QuartetFS Confluence for 'field name spaces' gives little other than a snippet of a document saying:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.