]> git.eshelyaron.com Git - emacs.git/commitdiff
Speed up loading modules
authorLin Sun <sunlin7@hotmail.com>
Wed, 14 May 2025 06:30:34 +0000 (06:30 +0000)
committerEshel Yaron <me@eshelyaron.com>
Tue, 27 May 2025 14:32:13 +0000 (16:32 +0200)
* 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)

src/lread.c

index 9b902532393417bf04f2daaafe20be0b3979c04c..40eb6ad7875d7b08ee02e0f4296e079a44429ce6 100644 (file)
@@ -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");