heroic
heroic copied to clipboard
Investigate potentially serious performance implications of seemingly unnecessary thread-per-log message logging implementation
So the serializeAndLog method is called by all "log this sentence to disk" methods in the Slf4jQueryLogger class.
This is incredibly wasteful as for every single line of the log file, a Thread is created and destroyed, which includes :
- a Thread object being allocated and GC'd
- all the trappings of a Thread object e.g. file handles, OS resources
- the actual OS thread that the Thread represents
- other stuff I've forgotten
We should - at the least - run some tests to determine how slow/wasteful this is, assuming realistic logging rates.
My money is that it's really bad and could have a significant effect on performance, assuming that these logging methods are called frequently enough.