Skip to main content
September 3, 2009
Question

Spark Text Component Changes

  • September 3, 2009
  • 2 replies
  • 1655 views

I just checked in some changes around the spark text components for Flex 4.  The summary is:

  1. Replace SimpleText with Label, a UIComponent version of the same component
  2. Instead of extending GraphicElement, RichText will extend UIComponent (like Label will)
  3. All of the spark text components will move to spark.components.*, so there will be spark.components.Label, spark.components.RichText, and spark.components.RichEditableText
  4. The base class for SimpleText and RichText, spark.primitives.supportClasses.TextGraphicElement, will now extend UIComponent (instead of GraphicElement) and be moved and renamed to spark.components.supportClasses.TextBase. All of our text skin parts will now be typed as TextBase instead of TextGraphicElement
  5. For now, RichEditableText and RichText will co-exist. Performance numbers showed that it may be possible to collapse them, but we don't have the time right now to do this. We will revisit this later on, time permitting.


A more extensive writeup around the these decisions is written up here: http://opensource.adobe.com/wiki/display/flexsdk/Spark+Text+Primitives+Decision .  It was checked in to the trunk with revision 9948.

If you have any questions, please let me know.

Thanks,

Ryan

This topic has been closed for replies.

2 replies

Participant
September 4, 2009

Could you provide some more details on the benchmarking?

Specifically:

1) Does the creation time for both SimpleTexts and Buttons refer to instantiation? Does it refer to the time it takes to add them as children?  Does it refer to the time it takes for a creationComplete event after adding these as children (GraphicElement children, as I understand it, are validated based on a complete life cycle of its parent, looping through its graphic element children and validating each)?

2) Do the components have text in them?  If so, what text (my understanding is that the memory cost for a TextLine increases per character, and the time and memory is increased per line)?

3) Can we have comparable profiling numbers against 3.x classes (UITextField and 3.4 Buttons)?

I also have an indirectly-related question, namely: Is SimpleText going to be used as a replacement for UITextField in all components?  This seems like it might get expensive if it's ever implemented in DataGrid classes.

September 4, 2009

Hey Christian,

1) It refers to instantiation and complete renderring (i.e.-waiting for an enterFrame event after adding all the components have been validated and renderered).  GraphicElements are not ILayoutManagerClients and not managed through the typical LayoutManager (whcih handles validation of components...not layout).  GraphicElements are validated by the Group component that is their parent.

2) The components have text in them--just a small minimal amount, something like "Field (" + x + "," + y + ")".  I don't know the performance characeristics of TextLines off the top of myhead.  We need to do a little more work here and make sure we take in to account "rich text" (like HTML text) vs. just plain old text.

3) The numbers for Spark and Halo buttons are fairly close (around 6000 ms for 1500 Buttons in Halo, 5000 ms for 1500 Buttons in Spark).  The numbers for UITextFields and Spark Labels are pretty comparable (around 130 ms for 240 UITextFields, 165 ms for 240 Spark Labels)

As for DataGrid, I don't know if we're committed to one approach or not.  Considerring a whole Flex application, the difference between a UITextField and a Spark Label isn't much (look at Button), but when looking at a datagrid the percentage is a little more.  Performance is definitely something we'll be looking at when we come up with a strategy here.

Let me know if you want some more clarification.

-Ryan

Participant
September 3, 2009

Hi Ryan,

Thanks for letting us know ... the link about the decision seems internal to

Adobe, could you please post it externally, would help a lot in

understanding the decision.

I'm wondering about the performance cost of this GraphicElement to

UIComponent transition of SimpleText .. which I'm using extensively in my

skins ... could you share some of these performance numbers you mentioned ..

would be a big help.

Thank you

Mrinal

Participant
September 3, 2009

Scratch that, looks like you already updated the link to opensource.adobe.com from zerowing.corp.adobe.com I got in the email .. thank you.

After reading the explanation ... I understand the position you guys are in ...  personally I would've prefferd having that little performance gain even if it came with a slight inconvenience of different text components, one for Halo and another for Spark

Thank you,

Mrinal