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

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 #450: String manipulation performance improvements

GitBox

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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

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

GitBox

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:
[hidden email]


Reply | Threaded
Open this post in threaded view
|

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

GitBox
In reply to this post by GitBox

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:
[hidden email]