font-utils.el disable its cache on X and Windows so every check for the
existence of a font recomputes the font list, which takes a
non-negligible amount of time, at least on X. This default is reasonable
as stated in the docstring of font-utils-use-memory-cache:
> Disabled on X11 and MS Windows by default, because font-family-list
> often gives truncated results before Emacs is fully initialized.
This is, however, unreasonable from unicode-fonts, where calls to check
the existence of fonts happens in a loop; during the loop, Emacs is not
going to suddenly become fully initialized, , so each call is
actually recomputing the same font list over and over again.
Enabling the font-utils memory cache, at least for the duration of
unicode-fonts-setup, thus drastically reduces the initial startup time,
or the startup time when the pcache store is reset for some reason.
No font supports all of Unicode or anywhere near it. It’s not even
really possible with current font formats. Therefore, rename
`doom-unicode-font` to `doom-symbol-font`. Only set it as a fallback for
characters in the `symbol` and `mathematical` scripts.
unicode-fonts takes 5-15 seconds to remap unicode blocks on first
invokation, but it does so invisibly because inhibit-redisplay and
inhibit-message are active during startup (to prevent unintended redraws
slowing down the startup process). This change ensures users get
meaningful feedback during this time.
- doom-post-init-hook was renamed doom-init-modules-hook
- doom-init-hook was renamed doom-before-init-modules-hook
- doom-init-modules-hook now runs before the user's config.el is run
- Moved doom-init-ui-hook to run later (on window-setup-hook rather than
emacs-startup-hook).
Yield a modest improvement in startup times.
Now that we are loading package autoloads files (as part of the
generated doom-package-autoload-file when running make autoloads), many
:commands properties are redundant. In fact, many def-package! blocks
are redundant.
In some cases, we can do without a config.el file entirely, and can move
into the autoloads file or rely entirely on package autoloads.
Also, many settings have been moved in their module's autoloads files,
which makes them available ASAP; their use no longer depends on module
load order.
This gained me a modest ~10% boost in startup speed.