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

Bug 325835

Summary: [Startup] Try to initialize injectors lazily
Product: [Modeling] TMF Reporter: Sebastian Zarnekow <sebastian.zarnekow>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 CC: sven.efftinge
Version: 1.0.0Flags: sven.efftinge: juno+
Target Milestone: M4   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Sebastian Zarnekow CLA 2010-09-21 07:53:40 EDT
The Ui Plugins will currently create the injectors for each contained language eager on bundle#start. As this is quite costly, we should consider to use a computing map:

new MapMaker().makeComputingMap(new Function<String, Injector>() {
  public Injector apply(String language) {
    return createInjectorFor(language);
  }
})

Therefore we may have to use ResourceServiceProviderDescriptors similar to EPackageDescriptor in the respective extension point implementation.
However it is worth the measure the actual performance gain prior to introducing this additional complexity. 
Furthermore we have to be careful with the semantic of eager singletons, e.g. the validators are not registered by means of an extension point but as a side effect upon injector creation.
Comment 1 Sebastian Zarnekow CLA 2011-12-02 09:59:57 EST
Pushed to master.
Comment 2 Karsten Thoms CLA 2017-09-19 17:38:17 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:49:29 EDT
Closing all bugs that were set to RESOLVED before Neon.0