]> granicus.if.org Git - procps-ng/commitdiff
top: raise the amount by which top's stat buffer grows
authorJim Warner <james.warner@comcast.net>
Fri, 26 Jun 2020 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@dropbear.xyz>
Mon, 29 Jun 2020 11:12:02 +0000 (21:12 +1000)
We won't go as far as the merge request shown below in
increasing buffer size, but we'll reduce substantially
total iterations while growing it to achieve one read.

[ and this seems in line with what was recently done ]
[ to accommodate the massively parallel environments ]
[ thru 2 abreast ('4') and combined cpus ('!') modes ]

Reference(s:
https://gitlab.com/procps-ng/procps/-/merge_requests/105

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c

index cc6f4f0c618f54c0804ceb29a2d33e2a6504c5d7..3dc55a6b946880af61503405f3d81cbac4ed04b5 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -2512,7 +2512,7 @@ static void cpus_refresh (void) {
    rewind(fp);
    fflush(fp);
 
- #define buffGRW 1024
+ #define buffGRW 8192
    /* we slurp in the entire directory thus avoiding repeated calls to fgets,
       especially in a massively parallel environment.  additionally, each cpu
       line is then frozen in time rather than changing until we get around to