You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by GitBox <gi...@apache.org> on 2020/09/05 12:41:56 UTC

[GitHub] [wicket] theigl opened a new pull request #450: String manipulation performance improvements

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


   This PR contains three minor performance optimizations:
   
   - Precompile pattern for unescaping attributes in `ResourceUtil`
   - Improve implementation of `Strings.join`
   - Replace custom implementation of replace in `Strings.replaceAll` with JDK's `String.replace`
   
   The implementation of `String.replace` in recent JDK versions is 10x faster than Wicket's current custom version:
   
   Benchmark           |                        Mode |  Cnt      |    Score  | Units
   ------------ | ------------- |  ------------- |  --: | -------------
   StringsBenchmarks.replaceAllNew           | thrpt  |  3 |  105062419,329 |  ops/s
   StringsBenchmarks.replaceAllOld        | thrpt  |  3 |  10191237,840 |  ops/s
   
   `Strings.join` is about 40% faster after my minor tweaks:
   
   Benchmark        |              Mode |  Cnt     |    Score    |      Units
   ------------ | ------------- |  ------------- |  --: | -------------
   StringsBenchmarks.joinWicketNew | thrpt   | 3 | 10444112,760 | ops/s
   StringsBenchmarks.joinWicketOld | thrpt   | 3 |  7695290,533 | 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:
users@infra.apache.org



[GitHub] [wicket] theigl merged pull request #450: String manipulation performance improvements

Posted by GitBox <gi...@apache.org>.
theigl merged pull request #450:
URL: https://github.com/apache/wicket/pull/450


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [wicket] theigl commented on pull request #450: String manipulation performance improvements

Posted by GitBox <gi...@apache.org>.
theigl commented on pull request #450:
URL: https://github.com/apache/wicket/pull/450#issuecomment-687724502


   Thanks @svenmeier and @solomax!


----------------------------------------------------------------
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:
users@infra.apache.org