From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Allen Wang Newsgroups: gmane.emacs.bugs Subject: bug#60810: 30.0.50; `while-no-input' in GUI(macOS) is much slower than emacs -nw Date: Sat, 14 Jan 2023 00:07:31 -0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007035a505f234d022" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1233"; mail-complaints-to="usenet@ciao.gmane.io" To: 60810@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 14 09:16:22 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pGbiA-00007P-97 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Jan 2023 09:16:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGbhw-0002Pu-2N; Sat, 14 Jan 2023 03:16:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGbhr-0002P4-7m for bug-gnu-emacs@gnu.org; Sat, 14 Jan 2023 03:16:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGbhq-0005rs-Vn for bug-gnu-emacs@gnu.org; Sat, 14 Jan 2023 03:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pGbhq-0003NY-Qy for bug-gnu-emacs@gnu.org; Sat, 14 Jan 2023 03:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Allen Wang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Jan 2023 08:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60810 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167368414612936 (code B ref -1); Sat, 14 Jan 2023 08:16:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Jan 2023 08:15:46 +0000 Original-Received: from localhost ([127.0.0.1]:53242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGbhZ-0003MV-D9 for submit@debbugs.gnu.org; Sat, 14 Jan 2023 03:15:46 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:36356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pGbXm-00037x-KW for submit@debbugs.gnu.org; Sat, 14 Jan 2023 03:05:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pGbXl-0000NR-Or for bug-gnu-emacs@gnu.org; Sat, 14 Jan 2023 03:05:38 -0500 Original-Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGbXj-0004SU-P6 for bug-gnu-emacs@gnu.org; Sat, 14 Jan 2023 03:05:37 -0500 Original-Received: by mail-ej1-x631.google.com with SMTP id az20so38152243ejc.1 for ; Sat, 14 Jan 2023 00:05:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=BvHikAd1mvKQ/ENkSbAFSQJeZBdsVbuOLMbjcIQSQZk=; b=olYSrxZjLub5jOXtFO1hygNcz0sq55zGly8ide5MKl9VP0UkIfiehTiLS8hiGc9tfL ahuTyfgL7zF2QUzk3tbIds/dONekxF+u4UrZ2G/nydYaqypUWyjBCXUs63/rtwIK2eX8 0tVlroFKrllxbnvlWJdi2X5atI13qJrk8AgwNTL1lkRygz6VwVyOKQtcqJEtDvBrCFZB ZYOdAK6o5PlraGwMYQewKo5sdCavCRCcKfst24+EYpkYT70R/sYZIcbLu69o8FCVtsUG GfQY0mTpU3pE34E6r2u9ncstlywsS7Qf2JmiNF7UrlzLwwdZ90lbvKuadZBt2No6v3SZ UAPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=BvHikAd1mvKQ/ENkSbAFSQJeZBdsVbuOLMbjcIQSQZk=; b=S6+1EY7e16E/BC1AsJOZRG+6N33RpWrSRaAosxLsXUO/6G3arrgcOdfGuMl/GHpNxu V6nK+ArMAAVkIt8fq6uDTqOqxS+svZrC2RYoXmH+ffSsJdTXRD1PfQn0BNd9oyZzrJxw m1Zagv7rzUFlyjd/F/rKPUIhE7Y3VvfGutquK6T6yi9jaIqA7HYRsDtTA/79FwcTuq0Z FXyUZ5Ykj+ClQBIN8I4+JVhrM/gE6xmKnctXZP88rBmnmC/qMt98eNpZwVh3A3TM2luI +zIpRFtl2TwEGdeCY6jN81VYhtjsqyO0PQUDCppxSoX8fq4C3kFkhV3W9QTlIQH91bed wIQQ== X-Gm-Message-State: AFqh2krYRU2NMKG0zrjHvkQmlG8KWNLis94d7/8eEm5uHGWh+/QJrndD XFGz8qcghRVU4lWS7OAClrO3QhH9ZbHr7iC/hICg7jmt/V4= X-Google-Smtp-Source: AMrXdXv3YY3wymQkn3dl6OvegexI6vWe/eSl0fCksZCS2cU1UZ57wq9Vf52CEcDi5GeY7AgGV3zRUAR6pjLhftzBghg= X-Received: by 2002:a17:906:3049:b0:844:436f:8c35 with SMTP id d9-20020a170906304900b00844436f8c35mr7653296ejd.12.1673683532787; Sat, 14 Jan 2023 00:05:32 -0800 (PST) Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=allenhw1996@gmail.com; helo=mail-ej1-x631.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 14 Jan 2023 03:15:42 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253335 Archived-At: --0000000000007035a505f234d022 Content-Type: text/plain; charset="UTF-8" Hi maintainers, To reproduce, I evaluated these in the scratch buffer. (defun sayhi (&rest _) (while-no-input (dotimes (_ 10000000) (random))) (message "Done.")) (add-hook 'post-command-hook 'sayhi) After `C-x C-e`-ing the last line, I kept typing some arbitrary text at a normal speed. With `emacs -Q -nw`, the last character shows up pretty much immediately after the new key is pressed (as I expect). In GUI, however, there is significant delay. Say if I type "hello world", then maybe "h" and "e" would show up, then nothing happens for a few seconds, then the rest would "burst out". I'm not sure if this is considered a "bug", so sorry if this isn't the right place to report this. But after looking at documentation and a few other bug reports, it sounds like people expect `while-no-input' to work in this scenario? Also I see completion packages like Corfu and Vertico wrap things in this macro in the post-command-hook, and despite them doing that, auto-completion is still quite laggy for me, _only_ when in GUI. If this is not a bug, where should I submit a feature request? Either way, thanks for your time. Allen --- In GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G9323)) of 2023-01-13 built on Allens-MacBook-Air.local Repository revision: 99120491730c5839a5ba15ded187d481af1e71a7 Repository branch: master Windowing system distributor 'Apple', version 10.3.1671 System Description: Mac OS X 10.14.6 Configured using: 'configure CPPFLAGS=-I/usr/local/opt/curl/include LDFLAGS=-L/usr/local/opt/curl/lib' Configured features: ACL GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP XIM ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t 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 font-lock-mode: t blink-cursor-mode: 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 emacsbug 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 mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils 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 lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 37461 8829) (symbols 48 5061 0) (strings 32 13063 2251) (string-bytes 1 377288) (vectors 16 10360) (vector-slots 8 162082 5991) (floats 8 21 23) (intervals 56 219 0) (buffers 976 10)) --0000000000007035a505f234d022 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi maintainers,

To reproduce= , I evaluated these in the scratch buffer.

=C2= =A0=C2=A0=C2=A0 (defun sayhi (&rest _)
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 (while-no-input
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (dotimes = (_ 10000000)
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (ran= dom)))
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (message "Done."))

=C2=A0=C2=A0=C2=A0 (add-hook 'post-command-hook= 'sayhi)

After `C-x C-e`-ing the last line= , I kept typing some arbitrary text at a normal speed.

=
With `emacs -Q -nw`, the last character shows up pretty much immediate= ly after the new key is pressed (as I expect). In GUI, however, there is si= gnificant delay. Say if I type "hello world", then maybe "h&= quot; and "e" would show up, then nothing happens for a few secon= ds, then the rest would "burst out".

I&#= 39;m not sure if this is considered a "bug", so sorry if this isn= 't the right place to report this. But after looking at documentation a= nd a few other bug reports, it sounds like people expect `while-no-input= 9; to work in this scenario? Also I see completion packages like Corfu and = Vertico wrap things in this macro in the post-command-hook, and despite the= m doing that, auto-completion is still quite laggy for me, _only_ when in G= UI. If this is not a bug, where should I submit a feature request?

Either way, thanks for your time.

=
Allen

---

In GNU= Emacs 30.0.50 (build 1, x86_64-apple-darwin18.7.0, NS
appkit-1671.60 Ve= rsion 10.14.6 (Build 18G9323)) of 2023-01-13 built on
Allens-MacBook-Air= .local
Repository revision: 99120491730c5839a5ba15ded187d481af1e71a7
= Repository branch: master
Windowing system distributor 'Apple', = version 10.3.1671
System Description: =C2=A0Mac OS X 10.14.6

Conf= igured using:
'configure
CPPFLAGS=3D-I/usr/local/opt/curl/include=
LDFLAGS=3D-L/usr/local/opt/curl/lib'

Configured features:ACL GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NSPDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP XIM ZLIB
Important settings:
value of $LANG: en_US.UTF-8
locale-coding-s= ystem: utf-8-unix

Major mode: Lisp Interaction

Minor modes in= effect:
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
sho= w-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-b= ar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-l= ock-mode: t
font-lock-mode: t
blink-cursor-mode: t
line-number-mod= e: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-m= ode: t
auto-encryption-mode: t
auto-compression-mode: t

Load-p= ath shadows:
None found.

Features:
(shadow sort mail-extr emac= sbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml= -sec password-cache epa derived epg rfc6068
epg-config gnus-util text-pr= operty-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse = rfc2231 mailabbrev gmm-utils mailheader
cl-loaddefs cl-lib sendmail rfc2= 047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils rmc iso-transl tool= tip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-t= ype elisp-mode mwheel
term/ns-win ns-win ucs-normalize mule-util term/co= mmon-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list rep= lace 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-l= ang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp5193= 2 hebrew greek
romanian slovak czech european ethiopic indian cyrillic c= hinese
composite emoji-zwj charscript charprop case-table epa-hook
jk= a-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
th= eme-loaddefs faces cus-face macroexp files window text-properties
overla= y sha1 md5 base64 format env code-pages mule custom widget keymap
hashta= ble-print-readable backquote threads kqueue cocoa ns lcms2
multi-tty mak= e-network-process emacs)

Memory information:
((conses 16 37461 88= 29)
(symbols 48 5061 0)
(strings 32 13063 2251)
(string-bytes 1 37= 7288)
(vectors 16 10360)
(vector-slots 8 162082 5991)
(floats 8 21= 23)
(intervals 56 219 0)
(buffers 976 10))
--0000000000007035a505f234d022--