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

Bug 369430

Summary: Slow typing in big php files – PHPStructuredEditor.selectionChanged() performance optimization
Product: z_Archived Reporter: Natalia Bartol <natalia.bartol>
Component: PDTAssignee: Natalia Bartol <natalia.bartol>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jacek.pospychala, kalin.a
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
PHPStructuredEditor.selectionChanged() wrapped in non UI job - patch jacek.pospychala: iplog+

Description Natalia Bartol CLA 2012-01-23 13:08:02 EST
Build Identifier: 

PHPStructuredEditor.selectionChanged() is responsible for calling methods like

resetHighlightRange();
markInNavigationHistory();

Computing the highlight range as well as marking in navigation history are time consuming and don’t require to be executed entirely in UI thread.  


Reproducible: Always
Comment 1 Natalia Bartol CLA 2012-01-23 13:27:56 EST
Created attachment 209931 [details]
PHPStructuredEditor.selectionChanged() wrapped in non UI job - patch

Changes introduced by attached patch:

1. As setSelection method is always called with parameter moveCursor=false PHPStructuredEditor.selectionChanged() is wrapped in non UI Job.
2. Two places that require execution in UI thread are wrapped in Display.getDefault.syncExec():
    a. Getting carret position in computeHighlightRangeSourceReference()
    b. Getting current selection in setSelection
Comment 2 Jacek Pospychala CLA 2012-01-24 02:36:35 EST
Natalia's patch applied.

great job Natalia!
Comment 3 Kalin CLA 2012-07-06 04:21:44 EDT
Fixed.
Closing...

Kalin Yanev
kalin.a@zend.com