Adobe scout is great profiling tool sometimes is annoying but only in usability wise.

During profiling application life cycle I have found some peeks of GC process. Like here:

bool

Nothing special at quick look, I thought that some uncleaned reference especially that body looks like:

So at first point I ensured myself that in every place I’m using some kind of worker instance of result just to reuse product of this method. It was clear. But GC problem still exits.

After that I started undermine statement “instance ||= new Instance()” And I thought that maybe in some case ‘new’ operator is called even if condition is not fulfilled. Quick trace inside TestClass. And it’s not called. That’s OK. But problem exists.

I did lucky shot, and I changed it to:

Problem has gone!

if

But wait. Why?

I checked deasembled code and it looks exactly the same:

There should be some difference. But not in this form. So let’s check ABC code:

IF statement

||= statement

There is only one difference. When I’m using IF statement there is extra type casting.

That is only one different between 2 swf files. But it influences on GC in some way. Why? because that is in iftrue scope. I have no idea. So far when I have no answer for this I will avoid this (very comfortable) statement.

Environment:

  • AIR SDK 14.0.0
  • Inline: false
  • Compile target Flash Player 14.0
  • Adobe Scout CC 1.1.3
  • FFDEC v.2.1.3

 

 
0 Kudos
Don't
move!