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

Bug 369690

Summary: [xtext][performance] override getExportedObjectsByType() in DescriptionAddingContainer and FilterUriContainer
Product: [Modeling] TMF Reporter: Knut Wannheden <knut.wannheden>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: sebastian.zarnekow
Version: 2.2.1   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
proposed patch none

Description Knut Wannheden CLA 2012-01-25 11:05:15 EST
The current implementations of getExportedObjectsByType() in the classes DescriptionAddingContainer and FilterUriContainer ends up iterating over all resources and calling the getExportedObjectsByType() method on those. It would be preferable to delegate the call instead.

Furthermore this method should be overridden by FilterUriContainer anyways to implement the filtering.
Comment 1 Knut Wannheden CLA 2012-01-26 07:33:25 EST
Created attachment 210110 [details]
proposed patch

If there is no objection I would like to apply the attached patch.

The performance problem was detected in a content assist use case. Normally this wouldn't make any difference really, as in the end the same thing would happen in ResourceDescriptionsData. But in our case the "index" is backed by a relational database and it is much better with a single query loading all objects compared to one query for every resource.

Also note that the two mentioned classes already override getExportedObjects(EClass, QualifiedName, boolean) for pretty much the same reason: This query is optimized inside ResourceDescriptionsData.
Comment 2 Sebastian Zarnekow CLA 2012-01-26 07:52:49 EST
+1
Comment 4 Karsten Thoms CLA 2017-09-19 16:56:35 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 17:07:40 EDT
Closing all bugs that were set to RESOLVED before Neon.0