GitHub user rovarga opened a pull request: https://github.com/apache/karaf/pull/378
Backport plugin optimizations from master OpenDaylight is a heavy user of feature generation and is using 4.0.9 branch currently. These fixes speed up build time considerably and should be backported. You can merge this pull request into a Git repository by running: $ git pull https://github.com/rovarga/karaf backport-plugin Alternatively you can review and apply these changes as the patch at: https://github.com/apache/karaf/pull/378.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #378 ---- commit cc857dfecac35c3dff3dc46c21d28ea1cb1a1e9d Author: Robert Varga <n...@hq.sk> Date: 2017-08-13T16:56:29Z Use java.util.file.Files.newInputStream() Instead of wiring to FileInputStream, which is hard to GC due to the presence of finalize(), use Files.newInputStream. Brings down feature generation time in OpenDaylight, before: real 2m5.828s user 2m14.886s sys 0m20.849s after: real 1m46.523s user 1m59.258s sys 0m17.048s Signed-off-by: Robert Varga <n...@hq.sk> (cherry picked from commit ed797960d2a43eee8c04a9572478320af2420cfb) commit 8d55bc782eb1a135b47b9eb3e989dd8d9244d88a Author: Robert Varga <n...@hq.sk> Date: 2017-08-13T17:38:26Z Cache unmarshalled Features If we are processing a deep feature tree with multiple dependencies referencing same features (like in the case of OpenDaylight), we end up unmarshalling the same features over and over again. Rather than doing that, instantiate a cache, which will hold a weak reference to features already encountered. Before: real 1m46.523s user 1m59.258s sys 0m17.048s After: real 0m42.642s user 1m0.892s sys 0m10.148s Signed-off-by: Robert Varga <n...@hq.sk> (cherry picked from commit 9714d76be6442faca13e6f45f02a27eac52b8ebb) commit 7e860d3392c947d662b1765a9206108a0222c7e0 Author: Robert Varga <n...@hq.sk> Date: 2017-08-13T18:26:17Z Reuse extracted manifest Obtaining the manifest can cost us some IO. Treat it as an invariant when determining whether a file is a bundle. Signed-off-by: Robert Varga <n...@hq.sk> (cherry picked from commit edcda0b0ea4a50ae8e8019af1eaff161507e3ee4) ---- ---