From: Lin Sun Date: Wed, 14 May 2025 06:30:34 +0000 (+0000) Subject: Speed up loading modules X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=73fc7095356212d0a6a3e8b40afa1f6736e8f80b;p=emacs.git Speed up loading modules * src/lread.c (get-load-suffixes): Don't try loading modules with suffixes from 'jka-compr-load-suffixes', since loading of compressed shared libraries is not supported (so attempt to look for them is just waste of cycles). (Bug#78416.) (cherry picked from commit 9f1cec6297d5c06dc38d52e8384d56811b35915a) --- diff --git a/src/lread.c b/src/lread.c index 9b902532393..40eb6ad7875 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1205,7 +1205,21 @@ This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */) Lisp_Object exts = Vload_file_rep_suffixes; Lisp_Object suffix = XCAR (suffixes); FOR_EACH_TAIL (exts) - lst = Fcons (concat2 (suffix, XCAR (exts)), lst); + { + Lisp_Object ext = XCAR (exts); +#ifdef HAVE_MODULES + if (SCHARS (ext) > 0 + && (suffix_p (suffix, MODULES_SUFFIX) +# ifdef MODULES_SECONDARY_SUFFIX + || suffix_p (suffix, MODULES_SECONDARY_SUFFIX) +# endif + ) + && !NILP (Fmember (ext, Fsymbol_value ( + Qjka_compr_load_suffixes)))) + continue; +#endif + lst = Fcons (concat2 (suffix, ext), lst); + } } return Fnreverse (lst); } @@ -5930,6 +5944,8 @@ the loading functions recognize as compression suffixes, you should customize `jka-compr-load-suffixes' rather than the present variable. */); Vload_file_rep_suffixes = list1 (empty_unibyte_string); + DEFSYM (Qjka_compr_load_suffixes, "jka-compr-load-suffixes"); + DEFVAR_BOOL ("load-in-progress", load_in_progress, doc: /* Non-nil if inside of `load'. */); DEFSYM (Qload_in_progress, "load-in-progress");