Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366720

Summary: Poor performance when applying custom syntax highlighting preference when big PHP file is open in the editor
Product: [WebTools] WTP Source Editing Reporter: Natalia Bartol <natalia.bartol>
Component: wst.sseAssignee: Natalia Bartol <natalia.bartol>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: nsand.dev
Version: unspecified   
Target Milestone: 3.3.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Improved invalidation of text presentation on highlighting style changed event nsand.dev: iplog+

Description Natalia Bartol CLA 2011-12-14 11:15:11 EST
Build Identifier: 

Attempt to apply custom syntax highlighting preference, i.e. new color for methods, when big PHP file is open in the editor (> 25k lines of code) freezes UI for few minutes. 


Reproducible: Always
Comment 1 Natalia Bartol CLA 2011-12-14 11:24:50 EST
Created attachment 208388 [details]
Improved invalidation of text presentation on highlighting style changed event

org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingPresenter.highlightingStyleChanged(HighlightingStyle highlighting)
operation seems to be very inefficient. Whole text representation is invalidated every time the 
if (position.getHighlighting() == highlighting && fSourceViewer instanceof ITextViewerExtension2)
condition is not met. 

Attached patch changes the flow and makes it similar to 
SemanticHighlightingPresenter.invalidateTextPresentation().
Comment 2 Nick Sandonato CLA 2011-12-14 16:06:22 EST
Thanks for the patch, Natalia. This looks like it'll help immensely! I've checked in the code for Indigo SR2 and Juno.