flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com.INVALID>
Subject Re: Private properties are undefined in JS and null in AS
Date Sat, 03 Jun 2017 15:30:19 GMT

On 6/2/17, 11:59 PM, "Justin Mclean" <justin@classsoftware.com> wrote:
>> 2) How much slower and fatter is initializing properties to null?
>Given it’s a one off and a comparison is likely to be made several time I
>would assume the cost of setting to null would be a lot lower.

I'm not sure it is always one-off.  I think every function call will need
to initialize its local variables.  But even a couple of thousand
initializations at startup might make download size and startup time a
factor.  So the data would probably need to measure how many new
initializations the framework would have to have.

Also, we have to remember that the final optimization is done by Google
and not us.  We are type annotating the output and they and/or the browser
runtimes may also someday optimize and auto convert "==" to "===" where it
can.  So it isn't clear to me that we have to manually go through and
replace our use of '=='.  I believe Flash's JIT also effectively auto
converts when it has sufficient type information.

Something the compiler could do is flag areas in the code where type
information is lacking.  That kind of thing may have greater impact on the
final performance.



View raw message