It's safe to say we don't know if AS is faster than MXML until we have the
data. It may be that MXML allows databinding and that is slower than
manually setting the values in AS3 in the renderer's data setter. So MXML
renderers can more easily get bogged down where as in AS3 you would
typically be manually controlling everything.

Personally, I think MXML was meant for the presentation layer. When you use
AS3 to write your item renderer you are defeating the purpose of it. If
it's slow then something else is wrong.

I've been doing tests manually using getTimer() and my own methods to test
them but it hasn't been validated by any outside source. Now that Scout is
out there may be a better way to test item renderers. There are ~3
different areas you would want to check. Creation, validation, rendering
and the reuse of an existing (or when the data is set).

Speaking of item renderers, is there a way to set or increase the number of
off screen renderers? Would that speed things up if there were more off
screen renderers? For example, having ten precached renderers would appear
smoother than just a few?


On Wed, Sep 18, 2013 at 10:54 AM, Alex Harui <aha...@adobe.com> wrote:

> AFAIK, no scientific study was done on the differences.  IIRC, Mike
> Labriola did a talk at 360|Flex 2012 on this topic.  The session video
> should be available.
>
> IMO, the biggest difference is data-binding.  Probably the second is
> "generality".  Many renderers are pretty simple.  If you want to just
> layout two icons and a label in a row, the MXML might look like:
>
> <HGroup><Image/><Image/><Label/></HGroup>
>
> The direct AS equivalent probably isn't much faster, but why use a
> container and a horizontal layout to manage just three things?  Just use
> the lightest base class you can find, add three children to them and write
> a simpler layout code.  Yes, it is more code for you to write, but the end
> result is that less code runs.
>
> On 9/18/13 2:47 AM, "Kessler CTR Mark J" <mark.kessler....@usmc.mil>
> wrote:
>
> >They are not that much slower with simple usage,.  MXML just wires or
> >sets up things automatically for you even if didn't explicitly set them
> >up yourself.
> >
> >Just don't bog them down either the AS/MXML down.   Use things like a
> >datachange event instead of bindings, contentcache / cacheasbitmap for
> >the images n such.  You probably won't notice a difference.
> >
> >-Mark
> >
> >-----Original Message-----
> >From: Cristian Spiescu [mailto:cristian.spie...@gmail.com]
> >Sent: Wednesday, September 18, 2013 5:12 AM
> >To: users@flex.apache.org
> >Subject: Re: renderer performance mxml vs actionscript
> >
> >Hello,
> >
> >I have an additional question regarding this subject, that intrigued me:
> >why are MXML renderers slower? Aren't they translated to ActionScript
> >code?
> >
> >Thanks.
> >Best regards,
> >Cristian.
> >
> >On 18.09.2013 09:46, Federico De Maddalena wrote:
> >> Hi,
> >> I read in some internet web pages, and someone in this group told me,
> >> that an item renderer wrote in mxml has worse performance than the same
> >> renderer wrote in pure actionscript. ok i believe and i trust this, but
> >> are there studies or analysis that demonstate this thesis? particularly,
> >> it would be interesting to see a comparison with the results on the
> >> performance. I don't know if someone has already done this study!
> >> Bye
> >> Federico
> >>
> >
>
>

Reply via email to