[
https://issues.apache.org/jira/browse/GROOVY-11571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17929144#comment-17929144
]
Paul King commented on GROOVY-11571:
------------------------------------
Hi Torsten, it's been a while since most of the core team have done a lot with
OSGi. We did make a change to the master and GROOVY_4_0_X branches related to
FRAGMENT HOST in the last few days as per GROOVY-11570. I suspect that doesn't
help you but it would certainly help us if you could test the snapshot releases
and check that at least doesn't impact you.
To answer your question, what is the reason for the current setting, well we've
had different folk using groovy requiring different OSGi requirements, so the
current settings were a compromise to keep as many folks as possible happy.
Having said that, it was a while ago when we set that value. Perhaps typical
usage has changed in the meantime and we could do some more research and try to
determine if it seems safe to change that value. We don't have a lot of test
coverage with different OSGi containers, so it might be hard for us to know if
changing that value might impact some of our users. We are certainly keen to
make changes to improve performance if it doesn't adversely impact some users.
> Performance problem in Eclipse RCP/OSGi/Equinox environment
> -----------------------------------------------------------
>
> Key: GROOVY-11571
> URL: https://issues.apache.org/jira/browse/GROOVY-11571
> Project: Groovy
> Issue Type: Bug
> Components: groovy-runtime
> Affects Versions: 4.0.25
> Environment: Eclipse RCP 4.25
> Reporter: Torsten Witte
> Priority: Major
>
> We have an Eclipse RCP application that includes Groovy (4.0.25) so that
> users can customise it via Groovy scripts (groovy, groovy-datetime,
> groovy-dateutil, groovy-json, groovy-templates, groovy-xml, groovy-yaml).
> Unfortunately, we have noticed that the compilation of each individual script
> takes several seconds (e.g. 3 seconds and more for a tiny script).
> We have discovered that it will be faster if we remove some Groovy libs (e.g.
> groovy-yaml), but that is not an option because we need the dependencies.
> Then we have noticed that the scripts compile in a few milliseconds if the
> application has been started with the Eclipse "-clean" parameter
> ("osgi.clean").
> The scripts can therefore be compiled much faster!
> However, the "-clean" parameter slows down the start of the application, as
> the OSGi configuration has to be recreated each time, and that is also not an
> option for us.
> It seems that Eclipse/OSGi/Equinox holds some wiring information in its
> configuration folder which slow down the Groovy compile times (more precise:
> the class loading).
> When drilling down into the problem, we got as far as buddy class loading,
> where the time is lost.
> The reason is in the {{MANIFEST.MF}} of the {{groovy_<version>.jar}}:
> {noformat}
> Eclipse-BuddyPolicy: dependent
> {noformat}
> Setting the value to "global" fixes the problem and the scripts are always
> compiled in a few milliseconds, whether starting the application with or
> without the "-clean" parameter.
> {noformat}
> Eclipse-BuddyPolicy: global
> {noformat}
> The documentation of the [Buddy Class
> Loading|https://wiki.eclipse.org/Context_Class_Loader_Enhancements#Buddy_Policy_2]
> says:
> bq. dependent - Consults all bundles that directly or indirectly depend on
> the bundle. An indirect dependency can be introduced by bundles that use
> Require-Bundle with the visibility directive set to reexport. Note that this
> casts a rather wide net and may introduce performance problems as the number
> of bundles increase.
> We use Require-Bundle in our {{MANIFEST.MF}} but without visibility reexport:
> {noformat}
> Require-Bundle: [...],
> groovy;bundle-version="4.0.25",
> groovy-datetime;bundle-version="4.0.25",
> groovy-dateutil;bundle-version="4.0.25",
> groovy-json;bundle-version="4.0.25",
> groovy-templates;bundle-version="4.0.25",
> groovy-xml;bundle-version="4.0.25",
> groovy-yaml;bundle-version="4.0.25",
> [...]
> {noformat}
> Are there reasons why the entry "Eclipse-BuddyPolicy" in the {{MANIFEST.MF}}
> of the {{groovy_<version>.jar}} is set to "dependent"?
> Is it possible to set the value to "global" in further releases?
> (Another problem with the Eclipse-BuddyPolicy is described in GROOVY-6491)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)