[
https://issues.apache.org/jira/browse/FELIX-5247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dmitry Konstantinov updated FELIX-5247:
---------------------------------------
Attachment: karaf_thread_creation.png
> Reduce number of threads created by Resolver during a startup of OSGi-based
> applications
> ----------------------------------------------------------------------------------------
>
> Key: FELIX-5247
> URL: https://issues.apache.org/jira/browse/FELIX-5247
> Project: Felix
> Issue Type: Improvement
> Components: Framework, Resolver
> Affects Versions: framework-5.4.0, resolver-1.8.0
> Reporter: Dmitry Konstantinov
> Labels: performance
> Attachments: karaf_thread_creation.png
>
>
> Thread creation is a quite expensive operation, so it make sense to reuse
> threads in ResolverImpl if they are needed to split some task and do it in
> parallel.
> For example: Apache Karaf startup with several features can install about 300
> bundles. If each one will create Runtime.getRuntime().availableProcessors()
> threads - so, during a startup about 1000 threads will be created only by
> Resolver (in case of a server machine even much more). Thread creation takes
> let's say (depends on machine, JDK, OS, etc) about 10-20 ms, so we are
> spending about 1-2 seconds of startup time only to create some threads.
> it make sense to create a thread pool once (with a configurable thread
> number) and reuse it for resolving of different bundles.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)