You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Sven Meier (Jira)" <ji...@apache.org> on 2020/04/27 20:16:00 UTC

[jira] [Resolved] (WICKET-6773) Improve performance of getting behaviors for components

     [ https://issues.apache.org/jira/browse/WICKET-6773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sven Meier resolved WICKET-6773.
--------------------------------
    Fix Version/s: 8.9.0
                   9.0.0-M6
         Assignee: Sven Meier
       Resolution: Fixed

Thanks again!

> Improve performance of getting behaviors for components
> -------------------------------------------------------
>
>                 Key: WICKET-6773
>                 URL: https://issues.apache.org/jira/browse/WICKET-6773
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core
>    Affects Versions: 8.7.0, 9.0.0-M5
>            Reporter: Thomas Heigl
>            Assignee: Sven Meier
>            Priority: Major
>             Fix For: 9.0.0-M6, 8.9.0
>
>
> Another method that showed up as hot in our production profiler is {{Behaviors.getBehaviors()}}.
> I wrote a JHM benchmark and identified the problematic part of the method as {{Collections.unmodifiableList(subset)}}. For components without behaviors *but with* model or metadata, this method wraps an empty list in an unmodifiable list. This seems to be extremely slow because it does not optimize for the case of an empty list.
> If we return {{Collections.emptyList()}} in this case, the throughput of the method nearly doubles:
> ||Benchmark||Score||Units||
> |BehaviorsBenchmarks.getOld|86802535,017|ops/s|
> |BehaviorsBenchmarks.getNew|143565516,640|ops/s|



--
This message was sent by Atlassian Jira
(v8.3.4#803005)