[ 
https://issues.apache.org/jira/browse/WICKET-6773?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17192786#comment-17192786
 ] 

Thomas Heigl commented on WICKET-6773:
--------------------------------------

[~bitstorm]: I just created WICKET-6826.

> 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, 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)

Reply via email to