[GitHub] [wicket] theigl opened a new pull request #455: WICKET-6835 Improve performance of `AbstractMapper.getPlaceholder`

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 #455: WICKET-6835 Improve performance of `AbstractMapper.getPlaceholder`

GitBox

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


   This is another small PR that significantly improves a "hot" method.
   
   Replacing `startsWith` and `endsWith` with `charAt` improves throughput by a factor of 3. It also prevents allocating a new String for non-placeholder segments because it does not use concatenation.
   
   Benchmark    |                      Mode |  Cnt    |      Score     |      Units
   ------------ | ------------- |  ------------- |  --: | -------------
   MapperBenchmarks.getPlaceholderNew | thrpt  |  3 | `406808071,934` |  ops/s
   MapperBenchmarks.getPlaceholderOld | thrpt  |  3  |    `132832411,311` |  ops/s
   
   https://issues.apache.org/jira/browse/WICKET-6835


----------------------------------------------------------------
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 #455: WICKET-6835 Improve performance of `AbstractMapper.getPlaceholder`

GitBox

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


   


----------------------------------------------------------------
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 #455: WICKET-6835 Improve performance of `AbstractMapper.getPlaceholder`

GitBox
In reply to this post by GitBox

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


   Thanks everyone!


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