Is the virtual keyword in Flex 3 a performance hit?

As the title says. Will the virtual keyword have a performance impact?

0


source to share


2 answers


First of all, in ActionScript, you don't need to explicitly specify a method to be overridden as virtual, as in C #, the compiler will do it for you. This is why the keyword does not appear in any documents because it is irrelevant to the developer's perspective.

To answer your question, although that means overriding a method makes it slower, the answer is not until your class is sealed, which means you don't use the "dynamic" keyword when defining a class.



The reason is that when you build a private class, you will have explicit markers for each method for that object, when you override a method, you get a marker directly to the new function, the class should not look at this at runtime, as in a dynamic class.

+3


source


All methods are now virtual in AS3. But my guess is "virtual", which will be implemented in a future version of AS poss. via some compiler option setting.



+1


source







All Articles