| Summary: | CSS Engine creates unnecessary contexts and injections | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] e4 | Reporter: | Oleg Besedin <ob1.eclipse> | ||||||||||
| Component: | UI | Assignee: | Bogdan Gheorghe <gheorghe> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | Bogdan Gheorghe <gheorghe> | ||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | ob1.eclipse, s.muecke | ||||||||||
| Version: | unspecified | ||||||||||||
| Target Milestone: | 1.0 RC2 | ||||||||||||
| Hardware: | All | ||||||||||||
| OS: | All | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
Created attachment 173128 [details]
Patch
Fixed in HEAD > 20100630 Created attachment 173573 [details]
go back to Method.invoke
This patch doesn't work quite right yet but it shows what I think we should do for 4.0.
(In reply to comment #4) > Created an attachment (id=173573) [details] > go back to Method.invoke > This patch doesn't work quite right yet but it shows what I think we should do > for 4.0. Hmm... that looks strange :-). We should #invoke() once, when the object is created and then simply change values in the context. That should have being "#inject()"; not "#invoke()". *** Bug 318798 has been marked as a duplicate of this bug. *** Created attachment 173721 [details]
Back to Reflection!
Fixed in HEAD > 20100707 |
Created attachment 169530 [details] Illustrative patch - not meant to be applied - just shows the problem About 30% of the time we spent to switch between the editors is spent in injection and processing of CSS attributes. 1) The CSS engine methods, such as CSSPropertyInnerKeylineSWTHandler#applyCSSProperty() seem to create unnecessary contexts on every editor tab switch. The common pattern for AbstractCSSPropertySWTHandler is: IEclipseContext childContext = context.createChild(); childContext.set("innerKeyline", newColor); ContextInjectionFactory.inject(renderer, childContext); I don't know the surrounding code, but unless it is doing something very special, the following woudl do the same: ((IEclipseContext) appContext).set("innerKeyline", newColor); without creating a new child context and injecting it. I'll attach an illustrative patch were I changed a few classes. ==== 2) The other strange thing is CSSPropertyTabRendererSWTHandler#applyCSSProperty(). That method is called several of times on tab switching (6 times for my compatibility workbench), and every time it creates a new context, a new CTabFolderRenderer class, and injects the new context into that new class.