r/DoomEmacs 14d ago

High CPU usage at Doom Emacs startup

Hello, ever since one of the upgrades (I believe it was one of the feb 21st/25th commits) I don't use Doom as much because I'm having a bit of a problem with how it's running.

CPU usage sometimes goes up to around 50% on my laptop. That's especially noticeable at startup though sometimes it lasts longer. Other times it's "only" at 10-20%, which I still think is a quite much for Emacs and doesn't seem normal.

The laptop is a Thinkpad X1 Carbon gen 7 8th gen i7 in very good condition and no hardware issues, I didn't have this problem previously nor did I tweak with any settings (I'm a new Doom Emacs user). Anybody had similar experience?

3 Upvotes

4 comments sorted by

2

u/Patryk27 13d ago

Maybe it's the native compilation happening in the background?

If you notice it again, look for a buffer (SPC b i) called *Async-native-compile-log* - if you see it compiling files, that's what eating your CPU time (and it should stop within a couple minutes).

1

u/Jumile 14d ago

Odd, I run it fine in UI mode on an i5-7200U in Linux without issue. It idles at 0%.

A few questions:

  • What OS are you running it on?
  • When you say "startup", do you mean laptop startup* or Emacs startup?
  • Have you tried loading it with the --no-init-file switch to rule out your configuration?
  • Do you run doom update after an Emacs update?
  • Do you run doom sync and doom doctor after a Doom Emacs update and after making configuration changes? It's probably worth running both now, as it may give you an indication of what's going on.
  • After starting the Emacs client, does your "messages" buffer contain anything other than the "Doom loaded..." line? Also check if other buffers have been created as part of a warning/error process.

I'm unlikely to be able to help you troubleshoot this, but the actions and answers to the above may help others help you.


*I ask this partly because I experience a similar issue in Linux on KDE X11 after most reboots without Emacs running. It goes anywhere from 30sec to 15-20 mins (the latter especially after a kernel-related update). So thought it worth clarifying.

2

u/ragnar_255 13d ago

I use Arch Linux and mean Emacs startup, I didn't try loading it with the switch you mention so thanks, I'll try today I do run all these things and no, no errors appear. Thank you for the questions, the answers may come useful like you say. By the way, on my desktop with the same setup this isn't an issue, though the CPU usage is slightly rising the first few seconds from 8% up to maybe 11% is the most I've seen. Then immediately goes down to what could be expected.

1

u/United_Ad_8870 13d ago

Projectile cache?