Added code, swf size ... less?

... I am working on several theories, but I am interested in hearing other opinions.

This has been tested on three different machines, two windows on another Linux. The compiler used is flexbuild (Presumably mxmlc) and ant with mxmlc.

We added the code to a small separate single .as file, and the size of the compiled swf file decreased by 20k, from 32k to 12k in the linux field. A little different on the window window, from 27k to 8.5k.

Using a special tool, we checked that both versions use their own compression of swf, massive additional metadata, the only modification to the ant build script is to add the swc file to the assembly.

The absence of code deletion (without import paragraph, without deleting variables, nada), only adding and quite simple in this case, a couple of components added to the scene, included, several small functions, etc., unchanged loops, nothing obvious that will result in less code.

Using the original control to create the old version still leads to a larger file, so it does not look like a change in the libraries or the compiler.

None of the codes use Flex components; they simply import a type of type "flash.etc ...".

Has anyone seen this behavior? What do you think can cause this?

+3
source share
4 answers

Previously seen this behavior in .NET assemblies.

( ) , , , , .

, ( - - , , , Adobe).

+2

, , , , ?

0

, swf , . , , -optimize = true.

, !

0

I have seen the same behavior before. I assume this is a combination of two factors: optimization and compression. Perhaps your new code allows the optimizer to do something differently (or, unintuitively, prevents some kind of inlay or loop reversal, which he did before). I would say that it is more likely that additional data became the best candidate for compression, since all flash files are compressed, so it was more efficient in compression. Both theories are only semi-educated guesses.

0
source

Source: https://habr.com/ru/post/1698764/


All Articles