bug#81548: 31.0.91; eglot extremely slow with large source files
Peter Wu <[email protected]> Mon, 3 Aug 2026 20:57:29 +0000
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
0. make sure you have clangd installed. I'm on macOS 26.6 and use the
system stock clangd: Apple clangd version 21.0.0 (clang-2100.1.1.101)
1. git clone https://github.com/wolfSSL/wolfssl
2. cd wolfssl
3. ./autogen.sh (assuming you have the autotools installed)
4. ./configure --enable-certgen \
--enable-certreq \
--enable-certext \
--enable-crl \
--enable-asn \
--enable-opensslextra
5. generate a compile_commands.json (I used: uvx compiledb make -j8)
6. make sure compile_commands.json has been generated (~475K in size)
7. create a $HOME/.emacs file with just these lines:
;;; -*- lexical-binding: t; -*-
(use-package eglot
:hook
((c-mode c++-mode) . eglot-ensure))
8. emacs wolfcrypt/test/test.c (this file contains 82K lines of code)
9. ensure eglot is enabled
10. search for a function, e.g. wc_RsaPrivateKeyDecode on line 28693
ret =3D wc_RsaPrivateKeyDecode(tmp, &idx, key, (word32)bytes);
11. move the point to the function
12. M-x xref-find-definitions RET
13. eglot hangs for, in my case, ~45 seconds, before locating the
definition
14. if you do it again on another function, it works quickly as expected
15. when eglot hangs for the first time, C-g is able to cancel the
operation
16. this performance issue happens on 31.0.91 and the master branch as
of this report but things work fine with 30.2 no hang.
17. I also tried c-ts-mode on 31.0.91 and the master branch, but the
problem can also be reproduced on both occasions
HTH
In GNU Emacs 31.0.91 (build 2, aarch64-apple-darwin23.6.0, NS
appkit-2487.70 Version 14.8.7 (Build 23J520)) of 2026-07-23 built on
builder-m1-14.lan
Repository revision: 1735bab5b34f9b81dcb9b77552b331be99c01845
Repository branch: HEAD
System Description: macOS 26.6
Configured using:
'configure --with-ns '--enable-locallisppath=3D/Library/Application
Support/Emacs/${version}/site-lisp:/Library/Application
Support/Emacs/site-lisp' --with-modules 'CFLAGS=3D-DFD_SETSIZE=3D10000
-DDARWIN_UNLIMITED_SELECT' --with-x-toolkit=3Dno
LDFLAGS=3D-headerpad_max_install_names'
Configured features:
ACL GLIB GMP GNUTLS JPEG LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS
PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
XIM ZLIB
Important settings:
value of $LANG: en_CA.UTF-8
locale-coding-system: utf-8-unix
Major mode: Fundamental
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
blink-cursor-mode: t
minibuffer-nonselected-mode: t
minibuffer-regexp-mode: t
buffer-read-only: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr compile comint ansi-osc ansi-color ring emacsbug
lisp-mnt message mailcap yank-media puny dired dired-loaddefs rfc822 mml
mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util
text-property-search time-date subr-x mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader sendmail mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils comp-run comp-common rx
term/xterm xterm cl-macs gv cl-extra help-mode cl-seq use-package-core
cl-loaddefs cl-lib bytecomp byte-compile rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads kqueue cocoa ns multi-tty make-network-process tty-child-frames
native-compile emacs)
Memory information:
((conses 16 93916 9870) (symbols 48 7527 0) (strings 32 25354 3290)
(string-bytes 1 799303) (vectors 16 13336)
(vector-slots 8 141010 8048) (floats 8 44 1) (intervals 56 409 4)
(buffers 1064 13))