| Summary: | [xbase][performance] Mark some services as singleton for an easy performance gain | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Sebastian Zarnekow <sebastian.zarnekow> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | knut.wannheden, sven.efftinge |
| Version: | 2.3.0 | Flags: | sebastian.zarnekow:
juno+
|
| Target Milestone: | M5 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Sebastian Zarnekow
When marking a service as singleton all transitive reps become defacto singletons. I wonder whether we want to explicitly mark everything as singleton or just the important top level components. As most of our injected services are stateless, marking all of them @Singleton sound like a good idea. I'm just a bit afraid of those cases where we accidentally introduced state... Those bugs are hard to find. +1 for marking all the stateless services as singleton We could write a unit test which inspects the injector for all singleton bindings and validates that no service is used which is not a singleton and that no field is declared which looks like state. Should be straight forward to implement with the binding SPI and / or the common types. Pushed some singleton-annotations to master Just out of curiosity: What was the actual test case for the benchmarks? I used the total execution time of org.eclipse.xtext.xtend2.ui.tests.performance.PerformanceTest and the number that is printed in assertFasterThen(..) as a simple heuristic. Closing this as the important types have been marked with @Singleton Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |