Community
Participate
Working Groups
Created attachment 173380 [details] Proposed patch for EclipseContext.dispose() EclipseContext does unnecessary object allocations. I found this problem when I wanted to create a temporary EclipseContext as follows: IEclipseContext context = EclipseContextFactory.create(); // ... set some values context.set(key, value); context.setParent(parentContext); // ... do something with the context context.dispose(); I expected that creating a context without a parent and setting some values should be a cheap operation. But, even though there are no listeners installed on the context, there is a lot of overhead when the context is changed. For example, the EclipseContext.dispose() method will always create a HashSet, an EclipseContext[]-array, and a Computation[]-array regardless of whether there are listeners.
Nice catch, thanks Stefan! Patch applied to CVS Head.