Bug 107879

Summary: MSLEventBroker could dispatch filtered notifications more efficiently
Product: [Modeling] GMF-Runtime Reporter: Chris McGee <cbmcgee>
Component: GeneralAssignee: Vishy Ramaswamy <vramaswa>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: vramaswa
Version: 1.0Keywords: contributed, performance
Target Milestone: ---   
Hardware: All   
OS: Windows XP   
Whiteboard:
Bug Depends on: 113708    
Bug Blocks:    
Attachments:
Description Flags
A patch to the org.eclipse.gmf.runtime.emf.core.compatibility plugin. none

Description Chris McGee CLA 2005-08-24 11:45:05 EDT
The MSLEventBroker currently generates a custom list of notifications for each
MListener individually. In many cases, MListeners are using some of our
predefined MFilters. Many of our most commonly used MFilters are singleton and
stateless. Therefore, once a list of notifications is filtered, that list will
remain the same for all other listeners using an equivalent filter.
Comment 1 Chris McGee CLA 2006-02-20 15:27:13 EST
After looking at many typical MListeners I discovered that most are using either MFilter.WILDCARD_FILTER or some tree of MFilters ANDed/ORed together. The MFilter.WILDCARD_FILTER case is already optimal in the event broker class. Also, because MFilter is public API and anyone can subclass it for their listener, there is no guarantee that even an identical MFilter will give the same response even with the same Notification. Attempting to normalize an AND/ORed tree of MFilters is a complex problem with significant performance impact.

A simpler solution that can actually solve some performance issues in the short term would be to reuse one list object for all listeners. This will save significant time in the garbage collector if there are alot of listeners.
Comment 2 Chris McGee CLA 2006-02-20 20:55:26 EST
Some testing shows that reuse of the list can save up to 15% of the time to perform an action and propagate the event to a large number of listeners.
Comment 3 Chris McGee CLA 2006-02-21 09:48:53 EST
Created attachment 35072 [details]
A patch to the org.eclipse.gmf.runtime.emf.core.compatibility plugin.
Comment 4 Vishy Ramaswamy CLA 2006-02-21 20:01:07 EST
Reviewed and applied patch
Comment 5 Eclipse Webmaster CLA 2010-07-19 12:24:34 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime EMF was the original product and component for this bug