]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rc.subr: Implement list_vars without using 'read'
authorConrad Meyer <cem@FreeBSD.org>
Tue, 11 Dec 2018 01:38:50 +0000 (01:38 +0000)
committerConrad Meyer <cem@FreeBSD.org>
Tue, 11 Dec 2018 01:38:50 +0000 (01:38 +0000)
commitb2b1708d5991878d6205ab1a1cae5762d956f129
tree87f1b238d396e438cd87daac7b9d8fa35cc747fa
parentc1745bf5036da58631cce53d78c9b3a09d648ddf
rc.subr: Implement list_vars without using 'read'

'read' pessimistically read(2)s one byte at a time, which can be quite
silly for large environments in slow emulators.

In my boring user environment, truss shows that the number of read()
syscalls to source rc.subr and invoke list_vars is reduced by something like
3400 to 60.  ministat(1) shows a significant time difference of about -71%
for my environment.

Suggested by: jilles
Discussed with: dteske, jhb, jilles
Differential Revision: https://reviews.freebsd.org/D18481
libexec/rc/rc.subr