Repository navigation
Do not build device Debug() strings when V(5) logging is off - #25
Merged
Merged
Conversation
Collaborator
Author
|
CPU profiles, cold start, first 150s, a node in dev with 4661 devices, 250m CPU (same as , same config as in inc 2122
Before (d8bb4e6)After (this PR) |
Jorres
force-pushed
the
fix/skip-device-debug-when-v5-off
branch
from
November 30, 2026 22:00
f7804c9 to
d882897
Compare
Collaborator
Author
|
Same setup, but also CPU limit 1 (was fixed after incident by Maxim Gorbunov) After (this PR), 1 CPU |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the change to skip device debug-string generation when verbosity-5 logging is disabled.
No open issues 🎉
What changed in this PR
Avoids expensive device debug-string generation when verbosity-5 logging is disabled, reducing unnecessary work in the plugin’s device-event handling.
Changes:
- Adds
logDeviceV5, which checks whether logging is enabled before callingdev.Debug(). - Routes six device-log calls in the add/remove handlers through the helper.
- Adds a changelog entry describing the startup CPU improvement.
| File | Description |
|---|---|
internal/plugin/scatter.go |
Guards device debug-string generation behind the verbosity check. |
.changes/unreleased/Fixed-20261130-225321.yaml |
Documents the performance fix and reported CPU reduction. |
Review effort: Balanced
mvgorbunov
approved these changes
Dec 1, 2026
ak0rz
reviewed
Dec 2, 2026
Collaborator
There was a problem hiding this comment.
Does this file/directory belong to repo? Maybe add .changes/ to .gitignore?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dev.Debug() evaluated in arguments to klog is REALLY expensive even if it isnt used
noticed that when taking profiles to figure out why udev-manager was cpu starved during inc 2122