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


Reply via email to