Bug 91764 - [Decorators] Need to optimize the fullDefinitions case
Summary: [Decorators] Need to optimize the fullDefinitions case
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2005-04-18 13:49 EDT by Tod Creasey CLA
Modified: 2005-05-10 13:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tod Creasey CLA 2005-04-18 13:49:18 EDT
As you will most of the time have no full decorator definitions we should do the
following:

1) If there are no full decorators skip the conversion to the array
2) enabledFullDefinitions should have the same short circuit
3) writeDecoratorsPreference should also short circuit
Comment 1 Tod Creasey CLA 2005-04-18 14:10:53 EDT
getDecoratorsFor is also creating garbage

   ArrayList decorators = new ArrayList();

        for (int i = 0; i < enabledDefinitions.length; i++) {
            if (enabledDefinitions[i].getEnablement().isEnabledFor(element))
                decorators.add(enabledDefinitions[i]);
        }

        return decorators;
Comment 2 Tod Creasey CLA 2005-04-25 09:38:39 EDT
Fixed in HEAD. This removes one ArrayList on every decoration request in the
general case where there are no full decorations.
Comment 3 Tod Creasey CLA 2005-05-10 13:51:23 EDT
Verified in 20050510