[
https://issues.apache.org/jira/browse/FELIX-4029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13638096#comment-13638096
]
Marcel Offermans commented on FELIX-4029:
-----------------------------------------
As far as I can see, what we do is perfectly fine according to the OSGi
specification. I don't see any mention in the API documentation that one or the
other way to invoke this method would be better for performance. Therefore I am
very hesitant to implement things that are dependent on implementation details
of Equinox.
If their code is faster when you supply both parameters, does equinox also
provide their own implementation of ServiceTracker that takes advantage of
this? Transforming all filters of the form "(&(objectclass=X)(whatever))" to a
call with parameters ("X", "(whatever)")? If we can work out some way to plugin
such code optionally so we can provide this as an Equinox specific add-on, that
would be nice. Perhaps we could even donate that to Equinox?!
> Improve use of BundleContext.getServiceReferences() API in ServiceTracker
> -------------------------------------------------------------------------
>
> Key: FELIX-4029
> URL: https://issues.apache.org/jira/browse/FELIX-4029
> Project: Felix
> Issue Type: Improvement
> Components: Dependency Manager
> Affects Versions: dependencymanager-3.1.0
> Reporter: Herko ter Horst
> Labels: performance
>
> The org.apache.felix.dm.tracker.ServiceTracker implementation currently does
> not take full advantage of the BundleContext.getServiceReferences() API when
> retrieving initial service references on "open".
> The getServiceReferences() method accepts a class name and a filter. The
> ServiceTracker accepts either one (but not both). However, it transforms the
> class name into a filter and calls getServiceReferences() with only the
> filter.
> This prevents BundleContext implementations from taking advantage of the
> class name parameter. At least one implementation (Equinox) indexes service
> references by their service interface. The fact that the class name is not
> available leads to reduced performance in this case.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira