Apparat (TAAS) framework to optimize swf

Joa Ebert is a Flash developer with a focus on ActionScript 3. He has developed several tools helping to optimize daily workflow. Most projects have been released as open-source. The most important one is Apparat / TAAS project:

Apparat is an open source framework written in Java to optimize ABC, SWC and SWF files. The core of Apparat are its three file formats and their implementation:

  • ABC (read and write ABC files, bytecode analysis and tools)
  • SWC (read and write SWC files)
  • SWF (read and write SWF files, tag implementations)

TAAS is a stackless representation of the ActionScriptBytecode. Read first results of TAAS, and see application before and after optimization.

The TAAS compiler is different from the ActionScript compiler since its input is not ActionScript source code but already compiled SWF or SWC files. Just like the haXe compiler can output AS3 instead of a SWF the TAAS compiler can do the same. Now if you add one and one together you see that the TAAS compiler can be used as a very strong decompiler. My own tests have shown that it will work flawlessly where other commercial decompilers output rubbish. Since the compiler behaves like the Flash Player it will “execute” the bytecode in order to parse it which means it has a very highlevel understanding of the structure inside the SWF. (Joa Ebert)

4 comments so far

  1. stephan December 15, 2011 13:35

    Hi there

    I recently stumbled upon this post
    which explains how to optimize as3 code via very simple rules.

    Aparat offers bytecode optimization. But I can´t find any information about what that really means.

    I am working on a quite big project right now and currently I am searching for further possible tweaks to it.

    So are these tips even relevant if I let Aparat do it´s bytecode magic anyway?

    Thanks in advance


  2. Jozef Chúťka December 15, 2011 14:15

    Hi Stephan,
    for deeper info you should visit developers website . e.g.

  3. stephan December 22, 2011 18:55

    hi jozef

    thanks you for your quick reply.
    the thing is: none the the links really provides me with the info if these changes would be made by apparat automatically.
    so, does apparat for example exchange
    x = x * 64;
    x = x << 1; (i´d say probably yes??)
    and if yes can apparat take it even further and
    var parts:Array = longString.split("|");
    var parts:Array = longString.match(/(.*?)\|/gm); (i´d say probably no??)
    so where exactly is the line of what apparats byte-optimization can and can´t do?



  4. Jozef Chúťka December 23, 2011 12:18

    hi stephan,
    I do not have personal experience with that, please try it yourself or ask Joa

Leave a comment

Please be polite and on topic. Your e-mail will never be published.