You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by GitBox <gi...@apache.org> on 2022/04/19 15:58:36 UTC

[GitHub] [wicket] astange1 commented on pull request #512: List.of() creates an immutable List instance, without a backing Array...

astange1 commented on PR #512:
URL: https://github.com/apache/wicket/pull/512#issuecomment-1102823621

   I just mistakenly pushed a 2nd commit into this pull request.    I was going to make this a 2nd pull request, but it can go here too.
   
   This 2nd commit greatly reduces the overhead of hashCode() computation in the rendering cycle as well.    These hashcode computations, which make calls to Objects.hash() create a temporary Object[] array, autobox the boolean and integer values, and are expensive due to this overhead.     I ran some tests on JDK17 and JDK19 using JMH and these Object[] creations are not elided in after inlining and after Escape Analysis.    One of our simplest Ajax callbacks results in 140 hashcode calls to the Abstract class.   In total, these changes avoid the creation of about 11KB of garbage memory in the server _per_mouse_click.     This code also runs in ~1ns, compared to ~15ns for the original code (on a M1 Ultra Macbook, JDK19).     On older JDKs, like JDK11, the original code is much more expensive by comparison.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@wicket.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org