aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/netdev-times.py
diff options
context:
space:
mode:
authorAndrei Vagin <[email protected]>2018-04-10 16:31:26 -0700
committerLinus Torvalds <[email protected]>2018-04-11 10:28:33 -0700
commitd0f02231222b313d1b49278cd2e3c7e7406fea6d (patch)
tree697b842799a294ccd856891458cb4820ebd22fee /tools/perf/scripts/python/netdev-times.py
parent48dffbf82d2f17bc6dd3c2b7fd733738ea567914 (diff)
proc: replace seq_printf by seq_put_smth to speed up /proc/pid/status
seq_printf() works slower than seq_puts, seq_puts, etc. == test_proc.c int main(int argc, char **argv) { int n, i, fd; char buf[16384]; n = atoi(argv[1]); for (i = 0; i < n; i++) { fd = open(argv[2], O_RDONLY); if (fd < 0) return 1; if (read(fd, buf, sizeof(buf)) <= 0) return 1; close(fd); } return 0; } == $ time ./test_proc 1000000 /proc/1/status == Before path == real 0m5.171s user 0m0.328s sys 0m4.783s == After patch == real 0m4.761s user 0m0.334s sys 0m4.366s Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Andrei Vagin <[email protected]> Cc: Alexey Dobriyan <[email protected]> Cc: KAMEZAWA Hiroyuki <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/netdev-times.py')
0 files changed, 0 insertions, 0 deletions