So the [serializeAndLog](https://github.com/spotify/heroic/blob/f2781c7579a0b107ffa404aae7f1971f43d65067/heroic-core/src/main/java/com/spotify/heroic/querylogging/Slf4jQueryLogger.java#L138) 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.
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 :
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.