From 67da836a276ca116ea792a7e71e33626358ed712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sun, 20 Sep 2026 11:24:25 +0800 Subject: [PATCH] Top: reduces `waitTime` to 250ms --- CHANGELOG.md | 2 ++ doc/json_schema.json | 2 +- src/modules/top/top.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bbd0736f1..0fa566349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ Changes: * `--logo-cache true` (the default) reuses a cached rendering when it is valid, and writes it back on a cache miss; `false` ignores the image logo cache completely, reading nothing from it and writing nothing to it; `regen` does what `--logo-recache true` used to do. `logo.cache` accepts a boolean, or the string `"regen"`. * The `waitTime` option of `DiskIO` and `NetIO` now defaults to `250` ms instead of `500`. (DiskIO / NetIO) * The byte counters are maintained by the kernel as I/O happens, so a shorter sampling window still yields an accurate rate, and both modules now finish about 250 ms sooner. The two modules wait concurrently, so enabling both does not cost twice the wait time. +* The `waitTime` option of `Top` now defaults to `250` ms instead of `500`. (Top) + * The operating system accounts process CPU time in fixed steps, so a window longer than roughly 150 ms does not visibly improve the reported percentages. The module now finishes about 250 ms sooner. Features: * Improved image logo support diff --git a/doc/json_schema.json b/doc/json_schema.json index 03ba42ece..a4ec51f8f 100644 --- a/doc/json_schema.json +++ b/doc/json_schema.json @@ -4513,7 +4513,7 @@ "type": "integer", "description": "Wait time between process samples, in milliseconds. Ignored when showTypes contains \"memory\" only", "minimum": 1, - "default": 500 + "default": 250 }, "compact": { "type": "boolean", diff --git a/src/modules/top/top.c b/src/modules/top/top.c index 9edbc394d..807533f35 100644 --- a/src/modules/top/top.c +++ b/src/modules/top/top.c @@ -252,7 +252,7 @@ void ffInitTopOptions(FFTopOptions* options) { #endif ; options->nProcesses = 5; - options->waitTime = 500; + options->waitTime = 250; options->compact = false; options->percent = (FFPercentageModuleConfig){ 50, 80, 0 }; }