all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs startup is suddenly slow
@ 2022-10-03  2:47 yPhil
  2022-10-03  3:06 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 2+ messages in thread
From: yPhil @ 2022-10-03  2:47 UTC (permalink / raw)
  To: help-gnu-emacs

Hello!

I just installed Emacs on a new machine, and noticed a considerable 
delay at startup, from my usual sub-two seconds to up to more than ten 
seconds! This gives me time to think and it's not good.

Here is the startup log:

Loading /etc/emacs/site-start.d/00debian.el (source)...done
Loading /etc/emacs/site-start.d/50autoconf.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el 
(source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el 
(source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done 
<= *This stays in the message area or a good 5 seconds*
Loading image-file...done
Loading display-line-numbers...done
Loading tab-line...done
Loading savehist...done
Loading paren...done
Emacs 27.1 loaded in 12.46 seconds with 8 garbage collections.
Loading /home/px/.emacs.d/recentf...done
Cleaning up the recentf list...done (0 removed)

Of course,emacs -q starts in under 2secs ; Here is the log:

Loading /etc/emacs/site-start.d/00debian.el (source)...done
Loading /etc/emacs/site-start.d/50autoconf.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el 
(source)...done
Loading debian-ispell...done
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el 
(source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.

So I figured that those loading commands (image-file, 
display-line-numbers, tab-line, savehist and paren, that all look 
important) were site-specific, and tried

emacs --no-site-file

But they seem to still be here, and still are quite blocking:

Here is the log:

Loading image-file...done
Loading display-line-numbers...done
Loading tab-line...done
Loading savehist...done
Loading paren...done
Emacs 27.1 loaded in 12.02 seconds with 8 garbage collections.

And when started with emacs -q --no-site-file the log is empty.

"For information about GNU Emacs and the GNU system, type C-h C-a."

I also tried ideas developed in this thread: 
https://lists.libreplanet.org/archive/html/bug-gnu-emacs/2018-03/msg00614.html 
such as enabling or disabling the loading of packages in the 
early-init.el file, but to no avail ; If anything it seems to slow make 
the startup even slower.

Here is my full init file: 
https://framagit.org/yphil/dotfiles/-/blob/master/.emacs

---------------------------------------

Any idea about what could be causing this saddening delay? Tomorrow I'm 
going to go ahead and buy the fanciest micro SD card in the store 
(https://www.tomshardware.com/best-picks/raspberry-pi-microsd-cards but 
the one I have now is really pretty good already I tried a lot of those 
and had freezes, but not that one, well except or Emacs startup) to try 
and see if this is just a read/write performance problem ; The thing is, 
as of today 27.1 seems to be more than two years old, if I'm not 
mistaking? It's always like that in Ubuntu ; Could this be an old, 
well-known and long fixed problem?

Thank you very much or your attention,

-- Philippe


# Version

GNU Emacs 27.1

# System

Linux 5.15.0-1015-raspi #17-Ubuntu SMP PREEMPT aarch64



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Emacs startup is suddenly slow
  2022-10-03  2:47 Emacs startup is suddenly slow yPhil
@ 2022-10-03  3:06 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2022-10-03  3:06 UTC (permalink / raw)
  To: help-gnu-emacs

> Of course,emacs -q starts in under 2secs ; Here is the log:
>
> Loading /etc/emacs/site-start.d/00debian.el (source)...done
> Loading /etc/emacs/site-start.d/50autoconf.el (source)...done
> Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
> Loading debian-ispell...
> Loading /var/cache/dictionaries-common/emacsen-ispell-default.el
> (source)...done
> Loading debian-ispell...done
> Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el
> (source)...done
> Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done
> For information about GNU Emacs and the GNU system, type C-h C-a.

`emacs -q` loads the site-specific files but not your personal config,
so the above is all the site-specific things.  And it seems they're
fast enough.

> So I figured that those loading commands (image-file, display-line-numbers,
> tab-line, savehist and paren, that all look important) were site-specific,
> and tried

No, the contrary`

> emacs --no-site-file
>
> But they seem to still be here, and still are quite blocking:
>
> Here is the log:
>
> Loading image-file...done
> Loading display-line-numbers...done
> Loading tab-line...done
> Loading savehist...done
> Loading paren...done
> Emacs 27.1 loaded in 12.02 seconds with 8 garbage collections.

Indeed, because these messages result from loading your own personal
config.  So, presumably *you* should know where they come from :-)

[ IIRC the above messages presumably come from your init file having
  explicit `load` (or `load-file`) calls to load those files, which is
  a bad idea since loading a file usually doesn't "do" anything.
  Instead you should just call `display-line-numbers-mode`, or
  `savehist-mode`, ... and the files will be auto-loaded for you (if
  needed), without emitting the above messages.  ]

Also your description suggests that Emacs sits "idle" for more than 5s
between the loading of the site-specific files and your own personal
init file.  So maybe the problem is in neither of those but
somewhere else instead.


        Stefan




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-03  3:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-03  2:47 Emacs startup is suddenly slow yPhil
2022-10-03  3:06 ` Stefan Monnier via Users list for the GNU Emacs text editor

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.