Bug 350456 - Performance issue with PDT problems decorator on every IResource
Summary: Performance issue with PDT problems decorator on every IResource
Status: NEW
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: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-27 10:58 EDT by Martin Oberhuber CLA
Modified: 2020-05-14 10:16 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2011-06-27 10:58:26 EDT
Build ID: PDT Helios SR2 (2.2.1) as well as PDT Indigo (3.0)
CQID:WIND00277026

The following 2 PDT decorator definitions in o.e.pdt.ui:

   org.eclipse.php.ui.problemsDecorator
   org.eclipse.php.ui.problemsDecoratorForIModelElement

are potentially problematic in terms of performance, because they trigger loading the DLTK Core and UI even if no PHP or DLTK functionality is needed.

This is problematic in our scenario, where we load a huge Linux Platform project with > 100k Resources. Somehow the decorators seem to trigger model initialization and store persistent properties, which leads to file access and is thus costly... even if no *.php file is ever visible in the Project Explorer and no PHP / DLTK nature is added to our project.

Suggested Improvements:
1.) Improve the Labels of the 3 PDT Decorators such that it's clear which one
    is which and I can turn off the right ones (today, there's 3 identical 
    labels for the 3 decorators).
2.) Improve the enablement expressions of the 2 resource-related decorators, 
    such that they are only invoked / loaded when a *.php file gets visible
    / rendered. The DLTK Model / Index should only be loaded when really 
    needed, and only for those files that are visible !

There might be more improvements to make, probably in coordination with the DLTK, but limiting those decorators to PHP files only rather than loading on _every_ file seems the most easy and fastest improvement to make.
Comment 1 Martin Oberhuber CLA 2011-06-27 11:35:57 EDT
Inside the DLTK model, this performance issue is also related to
  org.eclipse.dltk.core.DLTKContentTypeManager.ResetScriptValidPropertyListener
Comment 2 Martin Oberhuber CLA 2011-06-28 04:14:29 EDT
Digging just a little further, I found this text in the Javadoc comment of 
  org.eclipse.dltk.ui.ProblemsLabelDecorator 
which php.ui uses as implementation class for the problematic decorators:

 * <b>Important</b>: Although this decorator implements
 * ILightweightLabelDecorator, do not contribute this class as a decorator to
 * the <code>org.eclipse.ui.decorators</code> extension. Only use this class in
 * your own views and label providers.

I don't know why this comment is there, but it might be related to the performance issue we're seeing? - Adding some DLTK people for insight...
Comment 3 Martin Oberhuber CLA 2011-07-20 14:38:21 EDT
It looks like as a workaround, a product builder can disable the problematic PHP decorators by default, by putting this into plugin_customization.ini:

org.eclipse.ui.workbench/ENABLED_DECORATORS=org.eclipse.php.ui.problemsDecorator\:false,org.eclipse.php.ui.problemsDecoratorForIModelElement\:false,org.eclipse.php.ui.includepath.problemsDecorator\:false


but question is, why are those decorators defined so broadly, and why do they violate DLTK API? What are they meant for, after all? What are the side effects of disabling them?