• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Performance bug observed in BaseCompose.finishComposeLine

New Here ,
Oct 16, 2009 Oct 16, 2009

Copy link to clipboard

Copied

We were seeing some performance issues when editing documents and noticed that it was occurring in documents that had underlined text.  The issue was that any text line that contain underlined FlowLeafElements was getting extra Adornment Shapes added when the TextLine was reused during compose.
The code in question begins in BaseCompose.finishComposeLine:
        protected function finishComposeLine(curLine:TextFlowLine, lineSlug:Rectangle):void
    {     
     ...
      curLine.createAdornments(_blockProgression,_curElement,_curElementStart);
    }
  
The issue is that createAdornments does not check if the TextFlowLine already had Adornment shapes (for drawing the underlines) before updating and then adds another "Shape" object.   The net effect is that the TextLine in the display list gets redundant Shapes and performance begins to suffer.
     private function updateAdornmentsOnBounds(line:TextFlowLine, blockProgression:String, spanBounds:Rectangle):void
     {
          var tLine:TextLine = line.getTextLine();

          var selObj:Shape = new Shape();
        ...
          tLine.addChild(selObj);
     }
The problem was easy to reproduce once we better understood what was happening, every time we would see a compose happen for this line (e.g. hitting return above the line in question), more Shapes would be added.  When all that was really necessary was to move the TextLine.  Our fix was to change the line in 'finishComposeLine' to check if the curTextLine already had children, which implied that it had Adornments, and was being reused.

     //  Added check to determine if TextLine is being reused.  If the TextLine already has children
     //   it must be a reused line that is just being moved.   The children are the adornments used for underlines/strikethrough/etc...
     //
     if (curTextLine.numChildren == 0)
          curLine.createAdornments(_blockProgression,_curElement,_curElementStart);

Let me know if anything else is needed, or if I should go ahead a file a JIRA ticket for this.

Thanks,
Brett
                                                           

TOPICS
Text layout framework

Views

574

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 16, 2009 Oct 16, 2009

Copy link to clipboard

Copied

Hey, thanks for reporting that!  I'm seeing the same behavior on my end.  This could results in thousands of shapes being created in TextLine's for underline and strikethrough adornments.  Causes CPU and memory usage to skyrocket for longer textflows with lots of underlining/strikethrough...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 16, 2009 Oct 16, 2009

Copy link to clipboard

Copied

LATEST

I've written this up as a bug -- we will investigate.

- robin

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines