Community
Participate
Working Groups
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.
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.
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.
Created attachment 35072 [details] A patch to the org.eclipse.gmf.runtime.emf.core.compatibility plugin.
Reviewed and applied patch
[GMF Restructure] Bug 319140 : product GMF and component Runtime EMF was the original product and component for this bug