spotify / heroic

The Heroic Time Series Database
https://spotify.github.io/heroic/
Apache License 2.0
848 stars 109 forks source link

Investigate potentially serious performance implications of seemingly unnecessary thread-per-log message logging implementation #762

Open sming opened 3 years ago

sming commented 3 years ago

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.