Subject: 28.0.50; macOS scroll and movement latency slows when display changes

From: Doug Davis <[email-masked]>
Date: Wed, 12 Aug 2020 14:48:08 -0400

I'm observing this behavior on a MacBook Pro running macOS 10.15

initial condition: laptop is closed and plugged into an external display
over thunderbolt; I start and use Emacs with expected performance. After
unplugging the external display and opening the laptop to use by itself,
Emacs (which was already running) cursor movement and scrolling latency
shoots up (Emacs is just very "sluggish"). If I restart Emacs everything
goes back to normal. I'm observing the same behavior with 'emacs -Q'. I
don't see the same behavior from Emacs 27.1.

In GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin19.6.0, NS appkit-1894.60 Version 10.15.6 (Build 19G73))
 of 2020-08-12 built on top.local
Repository revision: a5a0a9c9ca0f0485db2c324a30109f655522800d
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1894
System Description:  Mac OS X 10.15.6

Recent messages:
‘epa-file’ already enabled
Waiting for git... [2 times]
[yas] Prepared just-in-time loading of snippets successfully.
Loading /Users/ddavis/.emacs.d/dot-emacs/email.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.

Configured using:
 'configure --with-ns --with-json --with-gnutls --with-xwidgets
 'CFLAGS=-mtune=native -march=native -O3''

Configured features:
JPEG TIFF GIF PNG NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS NS MODULES THREADS XWIDGETS JSON PDUMPER LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  company-mode: t
  rainbow-delimiters-mode: t
  gcmh-mode: t
  which-key-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  projectile-mode: t
  helm-mode: t
  helm-ff-cache-mode: t
  helm--remap-mouse-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  show-paren-mode: t
  global-auto-revert-mode: t
  whitespace-mode: t
  override-global-mode: t
  global-display-line-numbers-mode: t
  display-line-numbers-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  prettify-symbols-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort flyspell ispell mail-extr emacsbug message rfc822 mml
mml-sec gnus-util rmail rmail-loaddefs text-property-search mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils winner
helm-command helm-elisp helm-eval edebug backtrace helm-info
company-oddmuse company-keywords company-etags etags fileloop generator
company-gtags company-dabbrev-code company-dabbrev company-files
company-clang company-cmake company-semantic company-template
company-bbdb company-capf company rainbow-delimiters w3m mailcap
doc-view jka-compr image-mode exif timezone w3m-hist w3m-fb bookmark-w3m
w3m-ems w3m-favicon w3m-image tab-line w3m-proc w3m-util gcmh
doom-gruvbox-theme doom-themes doom-themes-base which-key blacken pyvenv
eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module
esh-groups esh-util clang-format xml lsp-pyls lsp-mode lsp-protocol
yasnippet-snippets yasnippet xref url-util tree-widget wid-edit spinner
pcase network-stream puny nsm rmc markdown-mode color inline imenu ht f
ewoc bindat flycheck rx rg rg-info-hack rg-menu transient rg-ibuffer
rg-result wgrep-rg wgrep rg-history rg-header helm-projectile projectile
grep compile ibuf-ext ibuffer ibuffer-loaddefs helm-mode helm-files
helm-buffers helm-occur helm-tags helm-locate helm-grep helm-regexp
helm-utils helm-help helm-types helm-config helm async-bytecomp
helm-global-bindings helm-easymenu helm-source eieio-compat
helm-multi-match helm-lib async pretty-hydra s dash-functional hydra lv
visual-fill-column crux tramp tramp-loaddefs trampver tramp-integration
files-x tramp-compat shell parse-time iso8601 ls-lisp thingatpt
exec-path-from-shell auto-package-update finder-inf dash paren dired
dired-loaddefs vc vc-dispatcher epa-file epa derived epg epg-config
autorevert filenotify whitespace project edmacro kmacro org ob ob-tangle
ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint
org-pcomplete pcomplete comint ansi-color ring org-list org-faces
org-entities time-date noutline outline org-version ob-emacs-lisp
ob-core ob-eval org-table ol org-keys org-compat advice org-macs
org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs server
cl-extra help-mode use-package use-package-ensure use-package-delight
use-package-diminish use-package-bind-key bind-key easy-mmode
use-package-core display-line-numbers tex-site w3m-load info package
easymenu browse-url url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
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 elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core term/tty-colors frame
minibuffer cl-generic 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 charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
threads xwidget-internal kqueue cocoa ns lcms2 multi-tty
make-network-process emacs)

Memory information:
((conses 16 504153 435087)
 (symbols 48 40200 489)
 (strings 32 159414 63817)
 (string-bytes 1 4857806)
 (vectors 16 62970)
 (vector-slots 8 736507 420998)
 (floats 8 462 1264)
 (intervals 56 448 254)
 (buffers 992 12))