Search code examples
resourcesosgiequinox

How much caching is built into Equinox and/or Felix resource loading from osgi bundles


When designing business logic which loads static resources from OSGi bundles (particulary with equinox and/or felix) how much effort should be put into optimizing performance of this?

Do these implementations already optimally serve resources? I don't want to reproduce logic needlessly.


Solution

  • This sounds like a classic case of trying to optimise too early. I would simply write the code in the clear and sensible way, and subsequently measure its performance. Possibly also compare the performance of Equinox and Felix when you do that.

    My instinct is that static resources will be loaded quite quickly from a bundle since it has a much smaller space to search than a traditional Java flat classpath. So as long as you know the right bundle to ask, and keep your bundles relatively granular, I would be surprised if you had any problems that would force you to optimise heavily.