aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Bosschaert (JIRA)" <>
Subject [jira] [Commented] (ARIES-1365) ServiceState attribute notifications slow down startup/shutdown time considerably
Date Mon, 24 Aug 2015 14:07:45 GMT


David Bosschaert commented on ARIES-1365:

Hi [~joelrich],

I looked at your patch and have the following small thoughts/comments:

* I see that you use StateConfig as 2 services. 
1. As a ManagedService to interact with ConfigAdmin.
2. As a StateConfig service to communicate the configuration to other parts of the JMX implementation.
Option 1 above is definitely necessary, but I'm wondering whether option 2 makes things a
little more complicated than needed. This is an object that you just need to communicate to
other parts of the JMX implementation. Would it maybe be simpler to just pass the StateConfig
service to the JMXAgentImpl constructor in Activator.start() as you've just created it one
line above. Then in JMXAgentImpl you can pass the object to all the other classes that need
it. That would simplify the logic in those classes to deal with the StateConfig service...
* I don't think we need the StateConfig.createConfiguration(). The ManagedService.updated()
callback is always made at least once, even if no configuration is available. So you can simply
set the default there if the value didn't come in from the dictionary. So I would just remove
that createConfiguration() method...
* [nitpick] I see that in the Activator.stop() you explicitly unregister the stateConfigService.
This is not needed. Stopping a bundle will automatically unregister its services.

> ServiceState attribute notifications slow down startup/shutdown time considerably
> ---------------------------------------------------------------------------------
>                 Key: ARIES-1365
>                 URL:
>             Project: Aries
>          Issue Type: Bug
>          Components: JMX
>    Affects Versions: jmx-core-1.1.3
>         Environment: org.apache.felix.framework 5.0.1
>            Reporter: Joel Richard
>            Assignee: David Bosschaert
>              Labels: performance, shutdown, startup
>         Attachments: 0001-ARIES-1365-ServiceState-attribute-notifications-slow.patch
> Around 20% of the startup time of our Felix OSGI container is spent creating attribute
notifications for changed services in ServiceState#getAttributeChangeNotification. This is
so slow because for each notification it calls bundleContext.getAllServiceReferences to get
all service ids.
> Here a few suggestions how this could be improved:
> - The ServiceState could maintain its own list of service ids which is updated according
to the service events
> - The ServiceState could implement the NotificationEmitter directly and be aware when
there are any listeners (in our case, there are mostly none).
> - Make it possible to disable the attribute change notifications with configuration property.

This message was sent by Atlassian JIRA

View raw message