Apache
Home » Documentation » Apache Felix Subproject Documentation » Apache Felix Dependency Manager

Dependency Manager - Performance Tuning

To further tune the performance of an application using Dependency Manager and a lot of services, we created the concept of filter indices. They work similarly to the way indices speed up relational database queries and are explained below.

Filter Indices

Filter indices allow you to speed up the service resolution process by skipping the services registry, in favor of a fast index on given service properties.

The Dependency Manager will look for a set of filter indices in the org.apache.felix.dependencymanager.filterindex system property. This system property uses the following syntax,

property-index ::= service-property | service-property ',' property-index
index ::= '*aspect*' | '*adapter*' | property-index
indices ::= index | indices ';' index

The implementation ships with three kinds of index implementations.

Performance

The index isn't free, but reduces the linear (and wasteful) filter-based lookup to an indexed log(n) lookup. You can expect noticeable speedup if you have at least several hundred services.

Examples

-Dorg.apache.felix.dependencymanager.filterindex=objectClass

Sets an index on objectClass, speeding up lookups for any filter that contains an objectClass in its filter (all regular services do).

-Dorg.apache.felix.dependencymanager.filterindex=objectClass,id

This filter helps if you have a lot of similar services, identified by some id.

-Dorg.apache.felix.dependencymanager.filterindex=objectClass,id;objectClass,ipAddress

This is a set of two filter indices, helping when you have one set of services that has an id, and another set that uses an ipAddress for identification.

-Dorg.apache.felix.dependencymanager.filterindex=*aspect*

Provides indexing for all Aspect services.

Rev. 1665812 by marrs on Wed, 11 Mar 2015 09:02:04 +0000
Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.