4 Replies Latest reply on Feb 26, 2010 9:01 AM by tehxike1

    Are there any statistics on vector vs. image efficiency?

    tehxike1 Level 1

      Right now my app has a lot of skins with vectors in them from Catalyst.  I was wondering if anyone's done any speedtests to show how big of a hit you take rendering a vector rather than slapping a png in.  Should vectors simply be used for graphics that you want to scale?

        • 1. Re: Are there any statistics on vector vs. image efficiency?
          CoreyRLucier Adobe Employee

          Certainly depending on your app, raster data can quickly add up.  Declarative vector data is certainly more compact, but depending on how you are using the graphics tags, runtime memory or performance could be a concern.

           

          Note that if you have large chunks of "static" vector content (icons, etc.) it's best to use compiled FXG rather than the graphics tags directly in your markup.  In this case things are optimized even further and your scaleable vector content is distilled down into flash player primitives (very low level tags).

           

          e.g. Any Graphic content living in MyIcon.fxg will be compiled down into a reusable component you can simply instantiate in your app as a whole -- much smaller than it's raster equivalent and of course is scaleable.

           

          Things add up at runtime though (memory wise) if you use many MXML graphic tags in your skin with complex layouts, etc. Each graphic tag corresponds to a script object that renders itself at runtime - so it's best you experiment a bit for your particular use case to find the best combination/permutation of raster vs. MXML graphics vs. FXG (static) vector content.

           

          -C

          1 person found this helpful
          • 2. Re: Are there any statistics on vector vs. image efficiency?
            tehxike1 Level 1

            I actually have never used the <Graphics/> tag...I just throw rects, paths, and lines right into groups and skinnable containers.  Is there any efficiency benefit of using a Graphics object?

             

            Ignoring the other benefits, would overall processing speed be PNG > FXG > MXML Graphics?

            • 3. Re: Are there any statistics on vector vs. image efficiency?
              CoreyRLucier Adobe Employee

              I would suppose you are correct, sounds right, but compiled FXG is pretty zippy.

               

              Example from our performance suite:

                  30 "weather" icons consisting of paths, fills, etc., time to instantiate - 500ms.

                  30 identical icons compiled as 'Graphics' (fxg components) - 45ms.

               

              Your specific choice would depend certainly on how large your PNGs were (and of course if you wanted high fidelity scaling).  A third option would be of course to just embed MovieClip assets directly from a Flash Authoring created SWF (roughly equivalent in size and performance to compiled FXG though).

               

              -C

              1 person found this helpful
              • 4. Re: Are there any statistics on vector vs. image efficiency?
                tehxike1 Level 1

                So if I bring a skin over from Catalyst that has some pretty elaborate vector work in it, is it adequate to rip the fancy stuff out of the skin, slap it in a *.fxg file, then use that *.fxg in the skin?

                 

                Are there any plans to support code hinting/highlighting for fxg's?  Right now if I edit one in FlashBuilder, it treats it like plain text- all black, no completion.

                 

                Thanks