]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
stand: lua: enhance lfs.dir() to speed up kernels_autodetect
authorKyle Evans <kevans@FreeBSD.org>
Sun, 24 Jan 2021 01:32:38 +0000 (19:32 -0600)
committerKyle Evans <kevans@FreeBSD.org>
Fri, 29 Jan 2021 18:47:29 +0000 (12:47 -0600)
commite25ee296c919d6567aa76058a7049eac974797fb
treed4bdac024242eced85fb80d9932b5052d9aa796c
parent80a840b8ba03bafe299112e2364959d937a87fe1
stand: lua: enhance lfs.dir() to speed up kernels_autodetect

This eliminates a lot of stat() calls that happen when lualoader renders the
menu with the default settings, and greatly speeds up rendering on my
laptop.

ftype is nil if loader/loader.efi hasn't been updated yet, falling back to
lfs.attributes() to test.

This is technically incompatible with lfs, but not in a particularly
terrible way.

Reviewed-by: cem
MFC-after: 4 days
Differential Revision: https://reviews.freebsd.org/D27542
libexec/flua/modules/lfs.c
stand/lua/core.lua