On 04. 05. 22 11:00, Stephane Epardaud wrote:
> Besides the numbers, I wonder why this is so complex. I would have
> thought that with Jandex being able to report use-sites of the
> `ServiceLoader` API, we could just replace the calls to
> `ServiceLoader.load(Class)` with calls to `$generated$loadServices`
> (containing `new Service[]{ new Impl(), new Impl2()}` if `Class` is a
> constant. No?
Hm, but this is not supported by Jandex yet, or?
> * It's rather straightforward to implement as there are no
> new concepts introduced, just reuse of existing Quarkus
> functionality
> * It provides the best possible runtime performance as
> service loader calls are replaced with simple
> constructor invocations
>
> The disadvantages are:
>
> * It can be tedious to implement as writing ASM code is
> not to most people's liking
> * Every new instance of the Service Loader we want to
> eliminate requires a new optimization
> * The optimizations (essentially ASM transformations)
> would require maintenance as they can get out of sync
> with the original code. It's important to note however
> that even if this happens, the application simply
> reverts to the default JVM behavior. Moreover, we can
> likely introduce tests that use ClassLoader events
> (which Sanne had added in the past) to ensure that the
> optimizations don't break.
>
> I benchmarked the effect of these optimizations on the
> startup time using our getting-started quickstart (using
> Java 11) and got the following results:
>
>
> *Original* *Optimized*
> Average 0.47739 0.46453
> Median 0.476 0.464
> 70th Percentile 0.485 0.468
> 80th Percentile 0.49 0.474
> 90th Percentile 0.4951 0.48
>
>
> I also have Java 17 numbers that show a very similar difference.
> Furthermore, also checked the effect on the size of the
> native binary and got the following:
>
> *Original* *Optimized*
> 36881K 36865K
>
>
> As you can see, the effects aren't mind blowing by any means.
>
> What do you think about this? Is it something worth pursuing
> in this form or another?
>
> --
> You received this message because you are subscribed to the
> Google Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails
> from it, send an email to
>
quarkus-dev...@googlegroups.com
> <mailto:
quarkus-dev...@googlegroups.com>.
> <
https://groups.google.com/d/msgid/quarkus-dev/CALeTM-kyM%2BeCk3GVkKeeJ0FW-yt%2BsxzZ94Rw3hS6HeaaXdJCZQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to
quarkus-dev...@googlegroups.com
> <mailto:
quarkus-dev...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/quarkus-dev/CALeTM-nP%2B0xoSbsrK5JZwo1M_e2WfgdfLXrKc0PrYMGDmvkh_A%40mail.gmail.com
> <
https://groups.google.com/d/msgid/quarkus-dev/CALeTM-nP%2B0xoSbsrK5JZwo1M_e2WfgdfLXrKc0PrYMGDmvkh_A%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
>
>
> --
> Stéphane Épardaud
>
> --
> You received this message because you are subscribed to the Google
> Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
quarkus-dev...@googlegroups.com
> <mailto:
quarkus-dev...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/quarkus-dev/CAKU9E9tqSuLk5iUWvJ2QUnbELbSGiMi7aR5v%2BjKHspk9NbzZOQ%40mail.gmail.com
> <
https://groups.google.com/d/msgid/quarkus-dev/CAKU9E9tqSuLk5iUWvJ2QUnbELbSGiMi7aR5v%2BjKHspk9NbzZOQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
--
Martin Kouba
Software Engineer
Red Hat, Czech Republic