Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve logging performance #466

hugbug opened this issue Nov 6, 2017 · 1 comment


None yet
1 participant
Copy link

commented Nov 6, 2017

With debug logging enabled (that requires debug build of NZBGet) program performance is seriously affected. The slow down is caused by inefficiencies in logger. Currently to add a message into log-file NZBGet:

  • opens log-file;
  • writes text there;
  • closed log-file.

Opening and closing for each message has an advantage that if the program crashes all messages are guaranteed to be written into output file.

However with debug logging a lot of messages are written and these frequent opening and closing of log-file degrade performance.

@hugbug hugbug added the improvement label Nov 6, 2017

@hugbug hugbug added this to the v20 milestone Nov 6, 2017

hugbug added a commit that referenced this issue Nov 6, 2017

#466: keep log-file longer open
that improve logging performance especially in debug build

hugbug added a commit that referenced this issue Nov 6, 2017


This comment has been minimized.

Copy link
Member Author

commented Nov 6, 2017

In order to improve logging performance the log-file remains open for extended period of time. To avoid loosing of messages on program crash the output buffers are flushed after each message.

Although we flush as often as before the avoiding of open/close significantly improves logging speed.

@hugbug hugbug closed this Nov 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.