]> git.eshelyaron.com Git - emacs.git/commit
Add load-path-filter-function and use it to optimize loading
authorSpencer Baugh <sbaugh@janestreet.com>
Thu, 1 May 2025 18:27:30 +0000 (14:27 -0400)
committerEshel Yaron <me@eshelyaron.com>
Tue, 27 May 2025 14:31:55 +0000 (16:31 +0200)
commit94c70843e64ebe4d8e5bc711e81d488ffbabdaef
treecae468e0a5964442d0be44d2ea997417f687e68a
parent11adcac6d0c5308b607cf7c11cfce4f34782fe99
Add load-path-filter-function and use it to optimize loading

When there are many directories on load-path, the part of load which
searches load-path can become very slow.  By filtering load-path up
front to only contain directories which are likely to contain the
searched-for file, load becomes much faster.

This can be set in early-init.el for maximum effect.

* lisp/startup.el (load-path-filter--cache)
(load-path-filter-cache-directory-files): Add.
* src/lread.c (Fload): Call load-path-filter-function.
(syms_of_lread): Add load-path-filter-function.

(cherry picked from commit e5218df144203ff1b5da3d46b7579b6455008ee7)
lisp/startup.el
src/lread.c