apache / apache/logging-log4j2

The performance of FileAppender significantly decreases under JDK21

Open
#3,393 1 comment 1 reaction 0 assignees View on GitHub
waiting-for-maintainer
Dominant language
Java
Stars
3.6k
Forks
1.7k
Avg merge
21h 30m
Merged PRs (30d)
27

Description

We tested FileAppender using JMH and found that compared to JDK1.8, the performance of JDK21 decreased by 30.5% (throughput decreased from 47.65 ops/ms to 33.08 ops/ms)

## configuration

1. Laptop configuration: I5-1350P CPU, 32GB DDR5 5200 RAM, and Samsung MZVL4512HBLU-00BLL 512GB SSD.
2. Log4j2 version is 2.24.3.
3. Perform three performance tests and calculate the average value.

## result

| **JDK Version** | **Score** | **gc.alloc.rate** | **gc.count** |
| --------------- | ------------ | ----------------- | ------------ |
| JDK 21.05 | 33.08 ops/ms | 635.45 MB/sec | 61.33 |
| JDK 1.8.171 | 47.65 ops/ms | 1,651.85 MB/sec | 294 |

For detailed code and configuration parameters , please refer to: [log4j2-perf-diff-jdk](https://github.com/zengzuo613/log4j2-perf-diff-jdk), Please refer to the complete test results: [jmh-result](https://github.com/zengzuo613/log4j2-perf-diff-jdk/tree/jdk1.8/jmh-result).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.