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

Bug 345150

Summary: Improve Resource.isFiltered() performance
Product: [Eclipse Project] Platform Reporter: Serge Beauchamp <serge>
Component: ResourcesAssignee: Serge Beauchamp <serge>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Szymon.Brandys
Version: 3.7Keywords: performance
Target Milestone: 3.7 RC1Flags: Szymon.Brandys: review+
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Serge Beauchamp CLA 2011-05-09 10:52:34 EDT
The implementation of Resource.isFiltered() is sub-optimal, because it iterates through all the parents of a resource to see if the resource is filtered out of a workspace, even if there's no resource filters in the project.
Comment 1 Serge Beauchamp CLA 2011-05-09 10:54:12 EDT
Created attachment 195079 [details]
Fix

The optimization consists of verifying ahead of the iteration if the project lacks resource filters, then returning false right away.
Comment 2 Serge Beauchamp CLA 2011-05-09 11:30:10 EDT
Can you review the patch for me please?  Thanks.
Comment 3 Szymon Brandys CLA 2011-05-10 05:36:52 EDT
Looks good.
Comment 4 Serge Beauchamp CLA 2011-05-10 06:47:32 EDT
This is now fixed on cvs head.