HomeFreeBSD

stand: lua: enhance lfs.dir() to speed up kernels_autodetect

Description

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

Details

Provenance
kevansAuthored on Jan 24 2021, 1:32 AM
Differential Revision
D27542: stand: lua: enhance lfs.dir() to speed up kernels_autodetect
Parents
rG80a840b8ba03: Revert "Cirrus-CI: Use the default Git history depth"
Branches
Unknown
Tags
Unknown