]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rc.subr: Implement list_vars without using 'read'
authorcem <cem@FreeBSD.org>
Tue, 11 Dec 2018 01:38:50 +0000 (01:38 +0000)
committercem <cem@FreeBSD.org>
Tue, 11 Dec 2018 01:38:50 +0000 (01:38 +0000)
commit46a4fa605e2c4b687c119f0ef0cdc970fb5af81e
tree87f1b238d396e438cd87daac7b9d8fa35cc747fa
parent934f800e42845cab51c070ada347d9055d1c3888
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