Replies: 8 comments 4 replies
|
Sounds like native compilation. Your Emacs is built with it. It runs in the background and natively-compiles Emacs Lisp files as they're loaded. It will stop once there are no uncompiled elisp files left. It will happen again anytime you update those packages (i.e. after a You can turn off JIT compilation with: ;;; add to $DOOMDIR/init.el
(setq native-comp-jit-compilation nil)Or you can adjust how many threads it may use (Doom defaults it to 1/4 of your CPU cores; on vanilla Emacs, the default is 1/2 your cores): (setq native-comp-async-jobs-number 1) ; only one threadSide-note: on Emacs 31+, Doom turns off native-comp when your system is running on a battery (e.g. a laptop). You may want to try either/both setting to see if your CPU issue goes away, to rule out other issues, but otherwise you should keep the feature on. It speeds up Emacs and happens less over time. |
|
Alternatively, you can append |
|
Thanks for the suggestions. I have tried all, both the `doom sync -u
--aot` and the changes to config.el and init.el.
Unfortunately, this does not change the CPU usage.
…On 4 Jul 2026, at 18:58, pancho horrillo wrote:
Alternatively, you can append `--aot` to either `doom upgrade` or
`doom sync -u` invocations to build the native code *ahead of time*.
It takes a while, but at least you can do it when it is convenient for
you (power-wise), and you reap the benefits of the improved general
performance every time you run Doom Emacs.
--
Reply to this email directly or view it on GitHub:
#120 (comment)
You are receiving this because you authored the thread.
Message ID:
***@***.***>
|
|
On 7 Jul 2026, at 12:32, Henrik Lissner wrote:
Some more things to try:
- Add Emacs.app to Developer Tools in Settings -> Privacy & Security
to exempt it from XProtect's runtime checks, which should mitigate the
performance overhead starting child processes.
On OSX I cannot find it.
- Try the emacs-build cask instead of emacs-plus. One of:
```sh
brew install --cask jimeh/emacs-builds/emacs-app # latest stable
release (30.2)
# OR
brew install --cask jimeh/emacs-builds/emacs-app-nightly # 32.0.50
Does not help out of the box.
Run `doom sync -u --env -aot`, which rebuilt every package because the
Emacs binary is now different after running the above. That also made no
difference: still between 30-45% CPU time.
```
- I see you have `exec-path-from-shell` installed. This launches your
interactive shell every time you start Emacs. If your shell dotfiles
are doing anything expensive (like calling `brew` commands or
initializing a very slow *env program, like rbenv or pyenv), then
you're doing it every time you launch Emacs. (Frankly, I'd suggest
just using `doom sync --env` instead of using `exec-path-from-shell`;
it was created for that very purpose, and is a one-time cost).
Done. No difference.
- Make sure the Symbola font is installed. Emacs uses it as a fallback
font to display glyphs your primary font can't display. If it's
absent, Emacs can churn its GC trying to find a substitute.
- In the shell: `defaults write org.gnu.Emacs
NSAutoFillHeuristicControllerEnabled -bool false`
- If you have any antivirus or MacOS has a runtime malware scanner (or
you have any accessibility features that run as-you-type), see if you
can add Emacs (and/or your `$EMACSDIR` and `$DOOMDIR`) to their
whitelists in your system preferences.
Done. No difference.
Profiling, most of the time seems to be the redisplay:
310 73% - byte-code
310 73% - read-extended-command
310 73% - read-extended-command-1
310 73% - completing-read-default
310 73% - apply
310 73% - vertico--advice
310 73% - apply
310 73% - #<byte-code-function 42A>
310 73% - apply
310 73% - #<native-comp-function completing-read-default>
145 34% - redisplay_internal (C function)
1 0% redisplay--pre-redisplay-functions
11 2% - vertico--exhibit
11 2% + vertico--protect
5 1% - timer-event-handler
5 1% + apply
1 0% + minibuffer--regexp-exit
55 12% - funcall-interactively
Is there anything else I could do to debug?
…
--
Reply to this email directly or view it on GitHub:
#120 (reply in thread)
You are receiving this because you authored the thread.
Message ID:
***@***.***>
|
|
I've added you as a collaborator to
https://github.com/renald/doom-emacs-d.
…On 7 Jul 2026, at 14:56, Henrik Lissner wrote:
Is your config up somewhere I can see it?
--
Reply to this email directly or view it on GitHub:
#120 (reply in thread)
You are receiving this because you authored the thread.
Message ID:
***@***.***>
|
|
Done that now. Makes no difference.
Interestingly, the CPU usage is only around 8% when on the doom 'home
page'. Only when I select a recently viewed file, it moves the the
40-45% level.
With kind regards,
Renald
…On 7 Jul 2026, at 14:59, pancho horrillo wrote:
Maybe try again to locate the whitelisting for Emacs.app on XProtect.
Also, maybe install Emacs via nix, in order to rule out issues with
the build you are using right now. (long shot)
--
Reply to this email directly or view it on GitHub:
#120 (reply in thread)
You are receiving this because you authored the thread.
Message ID:
***@***.***>
|
|
Question: does it ever stop using that much cpu, even if it takes hours? (Another possible for cpu usage could be Emacs building trampolines, which is what is needed for advised functions that live on natively-built modules. It should eventually finish building them and stop the cpu hogging). |
|
All the time... Even after days.
…On 7 Jul 2026, at 16:42, pancho horrillo wrote:
Question: does it ever stop using that much cpu, even if it takes
hours?
(Another possible for cpu usage could be Emacs building trampolines,
which is what is needed for advised functions that live on
natively-built modules. It should eventually finish building them and
stop the cpu hogging).
--
Reply to this email directly or view it on GitHub:
#120 (comment)
You are receiving this because you authored the thread.
Message ID:
***@***.***>
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Describe your issue
GNU Emacs 32.0.50 (build 1, aarch64-apple-darwin25.4.0, NS appkit-2685.50 Version 26.4.1 (Build 25E253)) of 2026-05-13
Doing no editing at all.
Profiler:
What could be wrong?
Wkr,
Renald
Steps to reproduce
Open emacs. Start top.
System information
https://pastebin.com/vGJQXK9x
All reactions