eclipse-ee4j / glassfish

Eclipse GlassFish
https://eclipse-ee4j.github.io/glassfish/
369 stars 136 forks source link

Performance test and fix for logger part of the logging system #24949

Closed dmatej closed 2 weeks ago

dmatej commented 3 weeks ago

Years ago I made some comparisons for JUL logging, but I never pushed those tests. Yesterday I had some doubts about the best way to format log messages, so I created a test. Meanwhile I noticed that one method in logger was not overridden and when I overrode it, it started failing the test. Long story short, GlassFish usually uses multiple handlers in parallel, so GJULE pushes common parts to caller threads to avoid duplicating and even blocking on handlers and formatters. But that means that the early resolution should not do work which is not required later - especially it should not analyze stacktraces when the detected class and method is not used in any output.

Oh, the original idea - yeah, MessageFormat is really slow compared to "+", StringBuilder, even behind suppliers. String.format is quiet slow too.

dmatej commented 3 weeks ago

Ok, yet once more to the Draft - missing documentation, and OneLineFormatter has printSource as true by default.