Revert log level caching in static fields
Description
Activity
Show:
Fixed
Details
Details
Assignee
John O'Hara
John O'Hara(Deactivated)Reporter
John O'Hara
John O'Hara(Deactivated)Components
Fix versions
Affects versions
Priority
Created May 28, 2019 at 3:41 PM
Updated May 30, 2019 at 2:12 PM
Resolved May 29, 2019 at 8:35 AM
Historically some classes have cached the logger level in static fields to prevent calls to the logging framework to reolve logging levels at run time.
Caching the log level at build time can cause a race condition in log levels at runtime, especially when the build system is multi-tiered. This is evident in a Quarkus native binary, as an incorrect log level at runtime;
https://github.com/quarkusio/quarkus/issues/2223
Optimisations in logging frameworks now mean that there is not a performance penalty for checking log level defined in the logging framework, removing the need to cache the log level.
I have verified that reverting the log level caching does not degrade performance in 2 of our benchmarks;
Rest-Crud-Http
Scenario
Max Requests/Sec
Quarkus JVM - Hibernate 5.4.2.Final
98,798
Quarkus JVM - Hibernate 5.4.2 + patch
133,682
Quarkus Native - Hibernate 5.4.2.Final
35,497
Quarkus Native - Hibernate 5.4.2 + patch
61,972
Insurance
Scenario
ops/sec Achieved
Request Mean Latency (s)
JVM - Hibernate 5.4.2.Final
1900.342
1.647
JVM - Hibernate 5.4.2 + patch
1913.358
0.209