Really liked the data driven approach of this article
Logging Performance Comparison
11–20 of 20 posts
Re: Logging Performance Comparison
#12for (; counter I think the JVM would optimise away this loop because it doesn't do anything. e.g. if the loop optimisation method is to unroll the loop into 1000 inline statements, there's nothing there. This makes "No Logging" result not quite a fair comparison; maybe something like the sum of 1000 random numbers do some actual work in the loop.
In many C/C++ optimizing compiler, this is replaced with `counter = 1000;`. I have no idea how java handle this.. Does the AOT compiler do any optimization? Would this defer to the JIT?
Re: Logging Performance Comparison
#13The one thing from modern Java logging I love and miss in other languages is being able to set log levels on specific loggers while the app is running.
Yeah it involves JMX, which has an annoying protocol that insists on domain names that you can resolve, making it a PITA with K8s from your local terminal, but it's such a QoL feature.
Re: Logging Performance Comparison
#14Now compare the efficiency of minimal logging compared to lotsa logging (even if most of it is only conditionally enabled), when optimising for dev time spent on troubleshooting :) The one thing from modern Java logging I love and miss in other languages is being able to set log levels on specific loggers while the app is running. Yeah it involves JMX, which has an annoying protocol that insists on domain names that…
Should work well with K8s config map mounted as volume.
Re: Logging Performance Comparison
#15Re: Logging Performance Comparison
#16Re: Logging Performance Comparison
#17Re: Logging Performance Comparison
#18Isn't buffered log writer prone to error (read not flushing to output) in case of ie. Premature container termination?
> The downside of this approach is that if the system crashes without a chance to flush the buffer, the last lines might not have been written and may be lost.
Re: Logging Performance Comparison
#19Now compare the efficiency of minimal logging compared to lotsa logging (even if most of it is only conditionally enabled), when optimising for dev time spent on troubleshooting :) The one thing from modern Java logging I love and miss in other languages is being able to set log levels on specific loggers while the app is running. Yeah it involves JMX, which has an annoying protocol that insists on domain names that…
Or even for successful requests per second averaged over spans of time including normal outages, degradations, and other indignities of life. It doesn't take many minutes at zero throughput to drag those averages down, so every minute shaved off by more illuminating logging is a performance benefit.
Re: Logging Performance Comparison
#20Earlier quoted context omitted.
In many C/C++ optimizing compiler, this is replaced with `counter = 1000;`. I have no idea how java handle this.. Does the AOT compiler do any optimization? Would this defer to the JIT?
There is aot native compilation in javaland these days, but I assume you mean javac, the compiler that transforms source into jvm bytecode. It defers pretty much all optimization to the JITs and won't remove empty loops.