Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312042 - [Xtext] Copious scope provider instances
Summary: [Xtext] Copious scope provider instances
Status: CLOSED WONTFIX
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 0.7.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-07 07:37 EDT by Johan Wannheden CLA
Modified: 2017-09-19 16:04 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johan Wannheden CLA 2010-05-07 07:37:28 EDT
Build Identifier: 20100218-1602

When profiling I detect that there are copious scope provider instances and wonder if that is correct. In the following areas scope provider instances are registered:

- classes in which the serializer is injected
- subclasses of DefaultTemplateProposalProvider
- subclasses of XtextContentAssistProcessor
- subclasses of DefaultLinkingService
- ...

In summary I get for one DSL which derives from another and has references to other languages about 14 scope provider instances after just starting up my eclipse run-time instance and opening a model. Does that sound reasonable?

Reproducible: Always
Comment 1 Sebastian Zarnekow CLA 2010-05-07 08:38:33 EDT
Hi Johan,

I don't think that this is a problem as we cache a lot of information in the resource itself (as an adapter). As far as I know there is no identity information of the scope provider itself involved in the cache-key. That's why I don't expect any performance or memory problems. Did you experience any improvements due to a @Singleton annotation on your scope provider?

Regards,
Sebastian
Comment 2 Johan Wannheden CLA 2010-05-07 08:50:48 EDT
Hi Sebastian,

since M6 I have not been able to see any performance issues regarding the number of scope providers. I just wanted to file this issue as a question and to know whether you think what I'm describing sounds like something is totally wrong on my side or whether that's normal. 

Thanks and regards,
Johan
Comment 3 Sven Efftinge CLA 2010-05-07 09:44:20 EDT
The default behavior with guice is that it creates a new instance for each dependency. As long as components are stateless (as is the case with all our scope providers) it doesn't really matter wether they are singletons or not so we go with the default. 
Setting it to won't fix.
Comment 4 Karsten Thoms CLA 2017-09-19 16:04:26 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.