ppkarwasz commented on PR #3338:
URL: https://github.com/apache/logging-log4j2/pull/3338#issuecomment-2566283448

   In 
https://github.com/apache/logging-log4j2/pull/3338/commits/0b198fc70df87e9757274d9cf9335be4ae27b008,
 I optimized performance a little bit, by:
   
   - replacing iterations over an `ArrayList` to iteration over an array.
   - unrolling the common case of two pattern sequences.
   - rewriting `formatFractionalDigits` to only use `StringBuilder.append()` 
and output the digits in order.
   - unrolling `formatFractionalDigits` for the common case of millisecond 
precision.
   
   Overall this gives a performance around 60% higher on the ISO8601 format:
   
   | Formatter type | Format | Score | Error | Units |
   | --- | --- | --- | --- | --- |
   | `InstantPatternFormatter` | `yyyy-MM-dd'T'HH:mm:ss.SSS` | 393.8 | ±18.1 | 
kops/ms |
   | `InstantPatternFormatter` | `HH:mm:ss.SSS` | 375.0 | ±14.4 | kops/ms |
   
   It also doubles the single-thread performance (around 23.1 kops/ms).


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

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to