felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-4692) Improve Service access time
Date Wed, 12 Nov 2014 14:40:33 GMT

    [ https://issues.apache.org/jira/browse/FELIX-4692?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14208081#comment-14208081

Richard S. Hall commented on FELIX-4692:

Did you investigate whether or not there was something that could be modified in the lookup
path to improve performance. If the service lookup is being done by className and no filter,
then I would expect that this would be reasonably straightforward since internally the ServiceRegistry.getServiceReferences()
method converts this to internal filter format (i.e., no parsing is required) and then does
a CapabilitySet.match() with the filter that should immediately it the index for objectClass
and return the matching result.

It would be interesting to know where it was spending its time to see if there was a general
fix for the issue. Perhaps there is no general fix and it is just the mechanics of doing it
generically that causes the slow down, but it would be nice to know more precisely.

> Improve Service access time
> ---------------------------
>                 Key: FELIX-4692
>                 URL: https://issues.apache.org/jira/browse/FELIX-4692
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: framework-4.4.1
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: framework-4.6.0
>         Attachments: FELIX-4692.diff
> Currently the ServiceRegistry takes roughly 1ms to access a single service. In a reasonably
large system, this may over time consume considerable time.
> For example in our inhouse system sporting roughly 5000 services with 15'000 service
accesses during startup, these accesses acount for almost 15 seconds or roughly 25-30% of
the total startup time.
> Internally all accesses to services are handled with a Filter even if the service is
simply retrieved with the service name without a filter. This causes a considerable overhead.
> A simple improvement is to keep services not only in a global Capabitliy Set accessible
through generic filters but also keep such a set for each registered service name.
> The measured improvement of this change is substantial: accessing these 15'000 services
now only takes roughly 3 seconds or 0.2 ms per service or 5 times faster.

This message was sent by Atlassian JIRA

View raw message