[GitHub] [wicket] theigl opened a new pull request #451: WICKET-6773 More performance improvements for Behaviors

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] theigl opened a new pull request #451: WICKET-6773 More performance improvements for Behaviors

GitBox

theigl opened a new pull request #451:
URL: https://github.com/apache/wicket/pull/451


   I made some initial tweaks to `Behaviors.getBehaviors()` in #422 but my profiler still shows a suspicious amount of allocation coming from this method.
   
   I overlooked one big potential improvement when I tried to improve the method the last time:
   
   The `ArrayList` that holds the behaviors is *always* initialized, even if we know that the component has no data. It is initialized with zero elements, but the overhead is still noticeable.
   
   I adjusted the method to return early in case there is no data and I'm lazily initializing the list in case there are no behaviors or no behaviors of the requested type.
   
   **Branch**
   Benchmark    |                      Mode |  Cnt    |      Score     |      Units
   ------------ | ------------- |  ------------- |  --: | -------------
   Behaviors.noData       | thrpt |   3 | 370553147,400  | ops/s
   Behaviors.onlyBehavior | thrpt |   3 |  79380410,149  | ops/s
   Behaviors.onlyMetaData | thrpt |   3 | 313669759,421  | ops/s
   Behaviors.onlyModel    | thrpt |   3 | 291586063,270  | ops/s
   Behaviors.noMatch      | thrpt |   3 | 251464191,584  | ops/s
   Behaviors.detach       | thrpt |   3 | 1521371870,081 | ops/s
   
   **Master**
   Benchmark         |                 Mode |  Cnt      |    Score        |   Units
   ------------ | ------------- |  ------------- |  --: | -------------
   Behaviors.noData       | thrpt  |  3 | 317804308,641  | ops/s
   Behaviors.onlyBehavior | thrpt  |  3 |  72185072,343  | ops/s
   Behaviors.onlyMetaData | thrpt  |  3 | 189207127,567  | ops/s
   Behaviors.onlyModel    | thrpt  |  3 | 207693228,485  | ops/s
   Behaviors.noMatch      | thrpt  |  3 | 208174862,835  | ops/s
   Behaviors.detach       | thrpt  |  6 | 1248153050,802 | ops/s


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] theigl merged pull request #451: WICKET-6773 More performance improvements for Behaviors

GitBox

theigl merged pull request #451:
URL: https://github.com/apache/wicket/pull/451


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

[GitHub] [wicket] theigl commented on pull request #451: WICKET-6773 More performance improvements for Behaviors

GitBox
In reply to this post by GitBox

theigl commented on pull request #451:
URL: https://github.com/apache/wicket/pull/451#issuecomment-689473791


   Thank you @svenmeier!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]