nstdio opened a new pull request #496: Avoid unnecessary allocation in 
wrapIfMissing.
URL: https://github.com/apache/commons-lang/pull/496
 
 
   Now `StringUtils#wrapIfMissing(String, char)` and 
`StringUtils#wrapIfMissing(String, String)` does not allocate buffer when input 
is already wrapped.
   
   Here are the benchmark results on my machine:
   
   ```
   Benchmark                    (input)   Mode  Samples    Score  Score error   
Units
   optimized    /should not be wrapped/  thrpt       20  357.849        4.525  
ops/us
   optimized          should be wrapped  thrpt       20   33.779        0.246  
ops/us
   original     /should not be wrapped/  thrpt       20   35.581        0.236  
ops/us
   original           should be wrapped  thrpt       20   33.671        0.360  
ops/us
   ```

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


With regards,
Apache Git Services

Reply via email to