11 Replies Latest reply on Apr 13, 2010 6:13 PM by Egor Chibisov

    Flex builder code size vs Flex SDK Ant build

    Egor Chibisov

      I have Flex builder project which produce swf file 650k. Using Flex builder 3.0.2

       

      For the same project I created ant file, used Flex SDK 3.2.0 from the same Flex Builder installation. Built applciation file size become 709k

       

      What the difference? Why?

      I tried many different options - did not found the cause.

       

      Any advise?

        • 2. Re: Flex builder code size vs Flex SDK Ant build
          msakrejda Level 4

          Comparing the link reports might tell you something. You can configure both the ant tasks and FB to keep link reports.

          • 3. Re: Flex builder code size vs Flex SDK Ant build
            Egor Chibisov Level 1

            Don't see the cause. Is there anything else that I could check?

            • 4. Re: Flex builder code size vs Flex SDK Ant build
              David_F57 Level 5

              Hi,

               

              You have gone to a later version of the sdk things get enhanced which means more embedded code after the build, this is very normal, If you did the same thing with the flex 4 sdk you wold end up with even more code added to you compile.

               

              If you are really concerned about this sort of thing you need to be optimising your code in an effort to keep swf files down, to do this you need to understand how the sdk code is brought into your projects.

               

               

              David.

              • 5. Re: Flex builder code size vs Flex SDK Ant build
                Egor Chibisov Level 1

                I have Flex Builder 3.0.2 installed.

                It include SDK 3.2.0, it is a part of Flex Builder 3.0.2 instllation.

                when I build the project, using Flex Builder user interface - size is smaller, when I use SDK command line build - size is bigger.

                 

                Isn't Flex Builder and included SDK (which is part of it) are using the same compiler and libraries?

                Inside flex builder UI, on project's properties I see that it is useing the same 3.2.0 SDK.

                • 6. Re: Flex builder code size vs Flex SDK Ant build
                  David_F57 Level 5

                  Sorry,

                   

                  I misread the post, I should clean the coffee smudges and nicotine build up off my glasses more often.

                   

                  Anyway for the immediate problem if sizes vary then its how you are doing an ant build, usually if I just let flex builder do a build it will end up with a larger swf, with an ant build I can be more particular about the optomization which gives me a 'cleaner' build. 

                   

                  With flex compare the release build the debug build and the ant build to see what variations you get. With ant you should be able to at least get the same compile size of the flex release build.

                   

                  Back to my errror post, it holds true when you try to compare builds on different sdks's(not that i'm trying to justify anything here ).

                   

                  David

                  • 7. Re: Flex builder code size vs Flex SDK Ant build
                    Egor Chibisov Level 1

                    Thanks for you reply. Well, my situation is up side down, I have ant build bigger then flex builder's one.

                    • 8. Re: Flex builder code size vs Flex SDK Ant build
                      David_F57 Level 5

                      Hi,

                       

                      Is it bigger than the debug build ? if so that may be part of the problem if you are compiling in debug information.

                       

                      David

                      • 9. Re: Flex builder code size vs Flex SDK Ant build
                        Egor Chibisov Level 1

                        No, it is smaller than build one.

                        Flex builder's build:666k

                        SDK build: ~727k

                        Flex Builder's debug ia ~ 1009k

                         

                         

                            <target name="compile">
                                <mxmlc
                                    file="${main.class}"
                                        output="${swf.export}"
                                        actionscript-file-encoding="${ENCODING}"
                                        keep-generated-actionscript="false"
                                        incremental="false"
                            >
                                <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/>
                                <source-path path-element="${FLEX_HOME}/frameworks"/>
                                <compiler.source-path path-element="${src.dir}"/>
                                <compiler.accessible>false</compiler.accessible>
                                <compiler.debug>false</compiler.debug>
                                <compiler.optimize>true</compiler.optimize>
                                   <compiler.include-libraries dir="${lib.dir}" append="true">
                                    <include name="flexunit.swc" />
                                    <include name="FlexUnitOptional.swc" />
                                    <include name="Cairngorm.swc" />
                                </compiler.include-libraries>

                            </mxmlc>
                            </target>

                        • 10. Re: Flex builder code size vs Flex SDK Ant build
                          levancho Level 3

                          Hi Egor, there is several things you can do to diagnose this issue,

                          1) simples is to generate link report from flex builder compiler paremeter is :  "-link-report filename.xml" you can pass to flex ADK compiler from

                          .project-properties --> flex compiler  and in dialoge you will see "additional compiler Arguments" .

                           

                          immediately after linkreport is generated,  do another build with ant this time,  again -link-report anotherxml.xml parameter passed in,

                          finally all you have to do is use some kind of diff tool, my fav is http://winmerge.org/

                          and see the different,Diff will  be those extra classes that you were hunting for

                          also can you post content of actionScript.properties file

                          its worth comparing flex builder compilation settings with your ants.

                          I suspect you do not need to bakein flexunit classes in your swf,

                          • 11. Re: Flex builder code size vs Flex SDK Ant build
                            Egor Chibisov Level 1

                            Flex builder ignore Compiler options when exporting release build. Any idea about it?

                            Tried to use debug link-report, but they just totally different from ant build ones..