From 731ae806eaa0ed9644d2e23ae0940599bfe5250b Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 29 Sep 2021 13:59:11 +0200 Subject: [PATCH] perf: pgtk-wait-for-event-timeout = 0.001 Thise should reduce the artificial latency added to window manager operations (like calls to some of Emacs' frame API, e.g. make-frame-invisible) on the PGTK build of Emacs. This should mitigate latency issues with childframes in general and packages that use them, e.g. lsp-ui and company-box. There's also a small chance 0.001 is much too low, and may cause artefacting on especially slow hardware. More testing is needed. --- core/core.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/core.el b/core/core.el index e0defa26a..2e3a9924e 100644 --- a/core/core.el +++ b/core/core.el @@ -306,6 +306,13 @@ config.el instead." ;; memory usage, however! (setq inhibit-compacting-font-caches t) +;; PGTK builds only: this timeout adds latency to frame operations, like +;; `make-frame-invisible', which are frequently called without a guard because +;; it's inexpensive in non-PGTK builds. Lowering the timeout from the default +;; 0.1 should make childframes and packages that manipulate them (like `lsp-ui', +;; `company-box', and `posframe') feel much snappier. See emacs-lsp/lsp-ui#613. +(setq pgtk-wait-for-event-timeout 0.001) + ;; Increase how much is read from processes in a single chunk (default is 4kb). ;; This is further increased elsewhere, where needed (like our LSP module). (setq read-process-output-max (* 64 1024)) ; 64kb