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

Asynchronous Logging #16

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

ziggyzaddy
Copy link

Notes

  • Added Asynchronous Logging to IRBTModUtils.Logging.ModLogWriter
  • Added two options to mod.json for enabling the feature as well as a (Built-In-Self-Test) for validating operation.
  • A statistics class for validating performance has also been added.
  • This is estimated to eliminate ~10us per message off the main thread from profiling, and reduce overall CPU consumption ~4x.

Optimizations

  • Dispatching messages through an MPMCQueue
  • Improve DateTime.ToString times by using fixed formatter and directly writing to output buffer
  • Reduce GC allocations and reuse a heap allocated buffer for main message writing.
  • Eliminate allocations for concatenations for spaces and newlines through pre-allocated heap buffers sized at 10x the max observed message size with truncation in event of overflow

Omitted

  • Encoding and flush optimizations are omitted
  • Exception and stacktrace logging use dynamically allocated strings and concats to avoid truncation. Generally not on hot-path.

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

Successfully merging this pull request may close these issues.

1 participant