Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369430 - Slow typing in big php files – PHPStructuredEditor.selectionChanged() performance optimization
Summary: Slow typing in big php files – PHPStructuredEditor.selectionChanged() perform...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Natalia Bartol CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-23 13:08 EST by Natalia Bartol CLA
Modified: 2020-05-14 11:16 EDT (History)
2 users (show)

See Also:


Attachments
PHPStructuredEditor.selectionChanged() wrapped in non UI job - patch (3.46 KB, patch)
2012-01-23 13:27 EST, Natalia Bartol CLA
jacek.pospychala: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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