From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nick OBrien via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69246: 30.0.50; persistent key input delay after using vc commands in pgtk Date: Wed, 21 Feb 2024 02:19:11 +0000 Message-ID: References: <86ttm5r3ud.fsf@gnu.org> <86msrxr2l0.fsf@gnu.org> <86a5nxqgio.fsf@gnu.org> Reply-To: Nick OBrien Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40866"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69246@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 21 08:33:59 2024 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 1rch79-000ANa-DR for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Feb 2024 08:33:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rch6u-0001P6-Tn; Wed, 21 Feb 2024 02:33:44 -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 1rch6q-0001OX-Q9 for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2024 02:33:42 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rch6q-0002L8-Hw for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2024 02:33:40 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rch7C-0004PY-MA for bug-gnu-emacs@gnu.org; Wed, 21 Feb 2024 02:34:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Nick OBrien Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 21 Feb 2024 07:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69246 X-GNU-PR-Package: emacs Original-Received: via spool by 69246-submit@debbugs.gnu.org id=B69246.170850079616882 (code B ref 69246); Wed, 21 Feb 2024 07:34:02 +0000 Original-Received: (at 69246) by debbugs.gnu.org; 21 Feb 2024 07:33:16 +0000 Original-Received: from localhost ([127.0.0.1]:47646 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rch6N-0004O8-Ug for submit@debbugs.gnu.org; Wed, 21 Feb 2024 02:33:15 -0500 Original-Received: from mail-4325.protonmail.ch ([185.70.43.25]:10423) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rccDC-0004cv-Fk for 69246@debbugs.gnu.org; Tue, 20 Feb 2024 21:19:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1708481966; x=1708741166; bh=spVN7Jwth1BBbr7GManv2wDf/ug1c6TcHNHIUXc4n+E=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=BxHhVftO12PEOW8d3Zsv2rZfu5FQu8J6jGEaSAziv7jjDVCLbQx4/+fhSPPfkI+8/ UK7tGoAMOMXIy4Re1SO/3/0c32kSHudikxtZWLA6/Ubrz8pzAPBKTY0DBT9DrF7V+7 m5xsTfv7RTgmW2LsL6vebLbGyMtqa+O1JQykcywypi9r8jkXMUanfpnQEyY8ahBHTa 7MN+q1Cq9XSdrko01sN3OaxY5vk0MxB6ypFwOXMnMIwViX8BuA5TB/wUAELJJA727J aOZ7ncajKINjX8zAx7wwx9MZguhkSvbrGx1RWcNm5PiEIpU4eBJ9IWDtCEWtuJF9Bh 7xK8d9KzL5IQw== In-Reply-To: <86a5nxqgio.fsf@gnu.org> Feedback-ID: 53815645:user:proton X-Mailman-Approved-At: Wed, 21 Feb 2024 02:33:09 -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:280373 Archived-At: > Thanks, but I don't see anything here which gives a hint why you see > the lags, nor even evidence that there was a lag. Maybe try leaning > on a key for 20 seconds, so that the keyboard auto-repeat produces > keypresses at high frequency -- maybe then the profile will tell > something. I followed the steps in the original bug report to reproduce the lag, then = I did the following: C-x b bar RET C-u 1000 C-q C-j M-< M-x profiler-start RET RET C-f ; held down for about 25 seconds M-x profiler-stop RET 552 82% - redisplay_internal (C function) 18 2% - eval 11 1% - if 8 1% frame-parameter 2 0% - display-graphic-p 1 0% framep-on-display 5 0% - mode-line-eol-desc 3 0% coding-system-eol-type-mnemonic 1 0% mode-line-window-control 5 0% file-remote-p 4 0% - mode-line-default-help-echo 3 0% - window-at-side-p 2 0% - window-pixel-edges 2 0% window-edges 1 0% window-normalize-window 1 0% minibuffer-window-active-p 3 0% - redisplay--pre-redisplay-functions 1 0% window-buffer 53 7% - command-execute 40 5% - byte-code 40 5% - read-extended-command 40 5% - read-extended-command-1 40 5% - completing-read-default 9 1% redisplay_internal (C function) 3 0% - funcall-interactively 2 0% execute-extended-command 3 0% interactive-form 3 0% handle-shift-selection 42 6% Automatic GC 9 1% - undo-auto--add-boundary 8 1% - undo-auto--boundaries 3 0% add-to-list 2 0% - undo-auto--ensure-boundary 1 0% undo-auto--needs-boundary-p 5 0% - tooltip-hide 2 0% tooltip-cancel-delayed-tip 4 0% clear-minibuffer-message 2 0% internal-timer-start-idle 2 0% - internal-echo-keystrokes-prefix 1 0% # 0 0% ... I did the same thing but longer (after restarting Emacs and reproducing the= lag): C-x b bar RET C-u 2000 C-q C-j M-< M-x profiler-start RET RET C-f ; held down for about 60 seconds M-x profiler-stop RET 1644 89% - redisplay_internal (C function) 28 1% - eval 18 0% - if 14 0% - frame-parameter 1 0% quote 3 0% - display-graphic-p 3 0% framep-on-display 5 0% - mode-line-eol-desc 2 0% coding-system-eol-type-mnemonic 2 0% - unless 2 0% # 1 0% mode-line-window-control 24 1% file-remote-p 10 0% - mode-line-default-help-echo 3 0% - window-at-side-p 1 0% - window-pixel-edges 1 0% window-edges 2 0% minibuffer-window-active-p 9 0% - redisplay--pre-redisplay-functions 3 0% - run-hook-with-args 2 0% redisplay--update-region-highlight 1 0% selected-window 1 0% window-buffer 96 5% Automatic GC 57 3% - command-execute 41 2% - byte-code 41 2% - read-extended-command 41 2% - read-extended-command-1 41 2% - completing-read-default 7 0% redisplay_internal (C function) 1 0% - minibuffer-mode 1 0% - run-mode-hooks 1 0% - run-hooks 1 0% - global-eldoc-mode-enable-in-buffers 1 0% - turn-on-eldoc-mode 1 0% eldoc--supported-p 3 0% interactive-form 3 0% handle-shift-selection 2 0% - funcall-interactively 1 0% forward-char 15 0% - clear-minibuffer-message 1 0% timerp 11 0% - undo-auto--add-boundary 11 0% - undo-auto--boundaries 6 0% - undo-auto--ensure-boundary 3 0% undo-auto--needs-boundary-p 5 0% add-to-list 6 0% - internal-echo-keystrokes-prefix 1 0% # 3 0% - internal-timer-start-idle 3 0% timerp 3 0% - tooltip-hide 1 0% tooltip-cancel-delayed-tip 2 0% - help-command-error-confusable-suggestions 2 0% - substitute-command-keys 1 0% generate-new-buffer 1 0% - # 1 0% - kill-buffer 1 0% - replace-buffer-in-windows 1 0% window-normalize-buffer 0 0% ... Just to be clear about the lag I'm observing, here's a couple scenarios: In the first one, say "abc" is already in a buffer. At time 0, I press the = "d" key and hold it. After 300 ms, I release the "d" key. Here's what the buffe= r looks like at various times (the times aren't exact, they're for demonstrat= ion): | Time (ms) | Key Event | Buffer (no lag) | Buffer (lag) | |-----------+-----------+-----------------+--------------| | 0 | "d" down | abc | abc | | 1 | | abcd | abc | | 100 | | abcd | abc | | 200 | | abcd | abcd | <- "d" appears a= fter lag | 300 | "d" up | abcd | abcd | However, "d" always appears immediately when I release the key. In the seco= nd scenario, I release "d" after 10 ms: | Time (ms) | Key Event | Buffer (no lag) | Buffer (lag) | |-----------+-----------+-----------------+--------------| | 0 | "d" down | abc | abc | | 1 | | abcd | abc | | 10 | "d" up | abcd | abc | | 11 | | abcd | abcd | <- "d" appears a= s soon | 100 | | abcd | abcd | as the key is= released In other words, if I press and release a key at the same time, the lag isn'= t noticeable. I only see the lag when I press a key and don't release it. Whe= n a key is held down and auto-repeating, I don't notice a drastic speed differe= nce with or without the lag. The appearing characters just look choppier when t= he lag is occurring. I realize this is an awkward bug to explain and reproduce, thanks for beari= ng with me. More suggestions on how to narrow down the cause would be apprecia= ted.