Subject: bug#74382: `compile-first` Make rule is no longer using `load-prefer-newer`

From: Konstantin Kharlamov <[email-masked]>
Date: Wed, 11 Dec 2024 14:19:45 +0300

On related note, I am wondering if it may be better to compile `COMPILE_FIRST` files
all at once?

I haven't found any robust way to measure building time of COMPILE_FIRST-only files
as part of the build system, via some sort of invocation like `make -C lisp
SOMETHING`.

So instead I tested by invoking buliding command manually from the `build/lisp` dir
like they would be invoked by Make. And I found x2.5 improvement in build time!

Testing old behavior:

    $ find ../../ -type f -name "*.elc" -delete
    $ time for f in ../../lisp/emacs-lisp/macroexp.el ../../lisp/emacs-lisp/cconv.el ../../lisp/emacs-lisp/byte-opt.el ../../lisp/emacs-lisp/bytecomp.el ../../lisp/emacs-lisp/comp.el ../../lisp/emacs-lisp/comp-cstr.el ../../lisp/emacs-lisp/comp-common.el ../../lisp/emacs-lisp/comp-run.el; do ../src/bootstrap-emacs -batch --no-site-file --no-site-lisp -l comp -f batch-byte-compile $f; done

    real    1m38.932s
    user    1m38.684s
    sys     0m0.116s

Testing "compile all at once":

    $ find ../../ -type f -name "*.elc" -delete
    $ time ../src/bootstrap-emacs -batch --no-site-file --no-site-lisp -l comp -f batch-byte-compile ../../lisp/emacs-lisp/macroexp.el ../../lisp/emacs-lisp/cconv.el ../../lisp/emacs-lisp/byte-opt.el ../../lisp/emacs-lisp/bytecomp.el ../../lisp/emacs-lisp/comp.el ../../lisp/emacs-lisp/comp-cstr.el ../../lisp/emacs-lisp/comp-common.el ../../lisp/emacs-lisp/comp-run.el

    real    0m39.970s
    user    0m39.896s
    sys     0m0.024s