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

ASF subversion and git services commented on WICKET-6830:
---------------------------------------------------------

Commit d18ea342dcd2034e1688c2fa997a69467353bec8 in wicket's branch 
refs/heads/master from Thomas Heigl
[ https://gitbox.apache.org/repos/asf?p=wicket.git;h=d18ea34 ]

Merge pull request #452 from theigl/WICKET-6830-static-behaviors

WICKET-6830 Convert `Behaviors` into a static utility

> Convert Behaviors into a static utility class to reduce allocations
> -------------------------------------------------------------------
>
>                 Key: WICKET-6830
>                 URL: https://issues.apache.org/jira/browse/WICKET-6830
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core
>    Affects Versions: 9.0.0
>            Reporter: Thomas Heigl
>            Assignee: Thomas Heigl
>            Priority: Major
>         Attachments: image-2020-09-13-11-07-51-274.png
>
>
> Under moderate load, my application allocates hundreds of MiB a minute in 
> {{Behaviors}} objects:
> !image-2020-09-13-11-07-51-274.png|width=362,height=376!
> {{Behaviors}} is a utility class to manage behaviors associated with 
> components. Instead of exposing static methods, {{Behaviors}} is instantiated 
> with the target component instance on every invocation. E.g.:
> {code:java}
> new Behaviors(this).onRemove(this); {code}
> This is slightly "more OO" than a static utility class, but it allocates on 
> every call. This can easily happen hundreds of times per request.
> I suggest to turn {{Behaviors}} into a simple static utility class and use it 
> like this:
> {code:java}
> Behaviors.onRemove(this); {code}



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

Reply via email to