You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Federico De Maddalena <f....@patente.it> on 2013/09/18 08:46:03 UTC

renderer performance mxml vs actionscript

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

Re: renderer performance mxml vs actionscript

Posted by Alex Harui <ah...@adobe.com>.

On 9/19/13 12:23 AM, "flexcapacitor@gmail.com" <fl...@gmail.com>
wrote:

>It's safe to say we don't know if AS is faster than MXML until we have the
>data. 
We do know that when we switched from MXML skins to AS skins things got
much faster.  And the same for renderers, but we did not analyze why.  If
you compare the generated code, though, the most obvious difference is all
of the binding code.

>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?
For Spark?  I don't think so.  It wouldn't speed up a regular List, but
could help for  a Tree where you expand/collapse nodes.


Re: renderer performance mxml vs actionscript

Posted by jude <fl...@gmail.com>.
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 <ah...@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" <ma...@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.spiescu@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
> >>
> >
>
>

Re: renderer performance mxml vs actionscript

Posted by Alex Harui <ah...@adobe.com>.
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" <ma...@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.spiescu@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
>>
>


RE: renderer performance mxml vs actionscript

Posted by Kessler CTR Mark J <ma...@usmc.mil>.
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.spiescu@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
>


Re: renderer performance mxml vs actionscript

Posted by Angelo Lazzari <la...@gmail.com>.
Hi guys,
i googoled for a few minutes and i found this [1] i think you can start
finding answers there, it's a bit outdated but the basic logics are the
same.

>From our experience problems comes when you are developing for mobile where
resources are limited...  If you have a quiet quantity of datas to display
(for example 100 quiet big records in a list view) Flex works perfectly
even if the items renderers are quiet complex MXML based customed, but if
you have to manage a lot of data, well, you'll notice the difference...

[1]
http://stackoverflow.com/questions/4510196/what-is-the-real-difference-between-mxml-and-actionscript-for-mobile

What time of project are you going to develop?

Cheers
Angelo



2013/9/18 Cristian Spiescu <cr...@gmail.com>

> 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
>>
>>
>


-- 
Angelo Lazzari
mobile: 0039 347 0090 452
mail: lazzari.angelo@gmail.com


----------------------------
Verificate la corrispondenza del destinatario; in caso contrario vogliate
notificare ciò al mittente e, consci della responsabilita'per l'uso
indebito, cancellare il messaggio e sue copie / Verify the correspondence
of the addressee; otherwise, notify that to the sender and, conscious of
the responsibility for the undue use, destroy the message and its copies.
----------------------------

Re: renderer performance mxml vs actionscript

Posted by Cristian Spiescu <cr...@gmail.com>.
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
>