Skip to content
This repository has been archived by the owner on Mar 27, 2021. It is now read-only.

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

Open
sming opened this issue Feb 16, 2021 · 0 comments

Comments

@sming
Copy link
Contributor

sming commented Feb 16, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant