-
Notifications
You must be signed in to change notification settings - Fork 2.7k
performance improvement proposal for God.getMonitorData hot path #6085
Description
Hi team :) id like to propose a small performance improvement in God.getMonitorData inside lib/God/ActionMethods.js. This path runs very frequently and currently does extra per-cycle work, so the goal is to keep behavior exactly the same while reducing internal overhead. The idea is to do a single pass to initialize default monit values and collect only valid online targets with valid pids, then apply pidusage stats in a separate linear pass directly on those targets. There are no API or contract changes, fallback behavior stays the same when pidusage fails or returns invalid data, and output semantics are unchanged. I validated the approach with local A/B benchmarks and targeted tests, and it shows measurable gains especially under higher process counts. If you agree with this direction, I can open a PR with the full diff and benchmark/test evidence.
Happy hacking.