karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rovarga <...@git.apache.org>
Subject [GitHub] karaf pull request #336: Optimize GenerateDescriptorMojo
Date Sun, 13 Aug 2017 17:51:11 GMT
GitHub user rovarga opened a pull request:


    Optimize GenerateDescriptorMojo

    OpenDaylight typically processes deeply nested feature.xmls, which takes significant time.
This PR optimizes GenerateDescriptorMojo, reducing build time observed by a factor of 3.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rovarga/karaf generate-features

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #336
commit 689b415c45a1f5ac21b29a08fd65408018c0772f
Author: Robert Varga <nite@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
    real    1m46.523s
    user    1m59.258s
    sys     0m17.048s
    Signed-off-by: Robert Varga <nite@hq.sk>

commit d429f8030235e5cfd1fd20130e231acf000b327b
Author: Robert Varga <nite@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.
    real    1m46.523s
    user    1m59.258s
    sys     0m17.048s
    real    0m42.642s
    user    1m0.892s
    sys     0m10.148s
    Signed-off-by: Robert Varga <nite@hq.sk>


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message