You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by "Erik J. Thomas" <er...@linqto.com> on 2017/05/24 22:52:30 UTC

Performance problem with RichText

Hey all:

We started noticing our mobile Flex app was unresponsive for like 5 or 6 seconds at launch where the UI was frozen. After profiling, we found the entire problem is with RichText and RichEditableText controls.

We have social posts (like twitter) that consist of a post (one RichEditableText control so links work) plus one or more comments on that post (one more RichEditableText so links work).

With only 18 posts (36 total instances of RichEditableText) it takes just about 5 or 6 full seconds for the text to be imported (average post size is 15 or 20 words)!

mainContent.textFlow = TextFlowUtil.importFromString(_post.text);
// we have one custom link embedding an id rather than href so we have to do this as well, which could be part of the problem
var linkElements:Array = StringUtils.findLinkElements(mainContent.textFlow);
for each (var link:LinkElement in linkElements) {
    link.addEventListener(FlowElementMouseEvent.CLICK, linkClickedHandler, false, 0, true);
}

and

commentContent.textFlow = TextFlowUtil.importFromString(content);

Is there any other alternative? Any ideas how I can use hyperlinks in text displayed in a flex mobile app that doesn't carry the TLF behemoth along greatly appreciated.

Erik

Re: Performance problem with RichText

Posted by "Erik J. Thomas" <er...@linqto.com>.
Clint, this is a great suggestion. I think I used this approach some years ago on one of my first Flex mobile apps, but forgot all about the approach. 

I just need to remember how to capture a hyperlink click for internal handling of some clicks, rather than just invoking default browser actions. But I seem to remember that was possible too.

I will definitely try this out tomorrow. Could be just what I need.

Thanks again!

Erik

> On May 24, 2017, at 4:22 PM, Clint M <cm...@gmail.com> wrote:
> 
> Would this work?
> http://help.adobe.com/en_US/flex/mobileapps/WS19f279b149e7481c-3c2dbaa612bb06a5ea2-8000.html
> 
> On Wed, May 24, 2017 at 3:52 PM, Erik J. Thomas <er...@linqto.com> wrote:
> 
>> Hey all:
>> 
>> We started noticing our mobile Flex app was unresponsive for like 5 or 6
>> seconds at launch where the UI was frozen. After profiling, we found the
>> entire problem is with RichText and RichEditableText controls.
>> 
>> We have social posts (like twitter) that consist of a post (one
>> RichEditableText control so links work) plus one or more comments on that
>> post (one more RichEditableText so links work).
>> 
>> With only 18 posts (36 total instances of RichEditableText) it takes just
>> about 5 or 6 full seconds for the text to be imported (average post size is
>> 15 or 20 words)!
>> 
>> mainContent.textFlow = TextFlowUtil.importFromString(_post.text);
>> // we have one custom link embedding an id rather than href so we have to
>> do this as well, which could be part of the problem
>> var linkElements:Array = StringUtils.findLinkElements(
>> mainContent.textFlow);
>> for each (var link:LinkElement in linkElements) {
>>    link.addEventListener(FlowElementMouseEvent.CLICK,
>> linkClickedHandler, false, 0, true);
>> }
>> 
>> and
>> 
>> commentContent.textFlow = TextFlowUtil.importFromString(content);
>> 
>> Is there any other alternative? Any ideas how I can use hyperlinks in text
>> displayed in a flex mobile app that doesn't carry the TLF behemoth along
>> greatly appreciated.
>> 
>> Erik


Re: Performance problem with RichText

Posted by Clint M <cm...@gmail.com>.
Would this work?
http://help.adobe.com/en_US/flex/mobileapps/WS19f279b149e7481c-3c2dbaa612bb06a5ea2-8000.html

On Wed, May 24, 2017 at 3:52 PM, Erik J. Thomas <er...@linqto.com> wrote:

> Hey all:
>
> We started noticing our mobile Flex app was unresponsive for like 5 or 6
> seconds at launch where the UI was frozen. After profiling, we found the
> entire problem is with RichText and RichEditableText controls.
>
> We have social posts (like twitter) that consist of a post (one
> RichEditableText control so links work) plus one or more comments on that
> post (one more RichEditableText so links work).
>
> With only 18 posts (36 total instances of RichEditableText) it takes just
> about 5 or 6 full seconds for the text to be imported (average post size is
> 15 or 20 words)!
>
> mainContent.textFlow = TextFlowUtil.importFromString(_post.text);
> // we have one custom link embedding an id rather than href so we have to
> do this as well, which could be part of the problem
> var linkElements:Array = StringUtils.findLinkElements(
> mainContent.textFlow);
> for each (var link:LinkElement in linkElements) {
>     link.addEventListener(FlowElementMouseEvent.CLICK,
> linkClickedHandler, false, 0, true);
> }
>
> and
>
> commentContent.textFlow = TextFlowUtil.importFromString(content);
>
> Is there any other alternative? Any ideas how I can use hyperlinks in text
> displayed in a flex mobile app that doesn't carry the TLF behemoth along
> greatly appreciated.
>
> Erik