AsyncTargetWrapper - Updated FullBatchSizeWriteLimit default value from 5 to 10#5924
AsyncTargetWrapper - Updated FullBatchSizeWriteLimit default value from 5 to 10#5924
Conversation
WalkthroughThe update changes the default value of the Changes
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/NLog/Targets/Wrappers/AsyncTargetWrapper.cs (1)
230-236: Synchronize docs / configs & consider extracting magic numberChanging the default
FullBatchSizeWriteLimitfrom 5 → 10 doubles the amount of work a single timer cycle may execute (potentially 10 ×BatchSize= 2 000 events with current defaults).
No functional problem is apparent, but please verify:
- External documentation / XML comments / wiki pages that mention the previous default are updated.
- Unit / benchmark baselines that assert the old value are adjusted.
Minor refactor suggestion: extract the default into a
const int DefaultFullBatchSizeWriteLimit = 10;(or a staticConfigurationItemFactorydefault) to avoid a magic number re-appearing in future patches.
|



Scheduling a new Timer-event has an overhead, so performing more work within the Timer-event will be faster.
Instead of limited to 5 * 200 every 1ms (1.000.000 logevents/sec) then it will be 10 * 200 every 1ms (2.000.000 logevents/sec)
Reducing the chance of dropping logevents with default overflowAction = discard. And better benchmark scores.