From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#46350: 28.0.50; touchpad-scrolling-eats-lots-of-cpu-samples Date: Sun, 07 Feb 2021 19:49:37 +0200 Message-ID: <83h7mnn4y6.fsf@gnu.org> References: <83a6shnklg.fsf@gnu.org> <838s81nhoz.fsf@gnu.org> <8335y9neut.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36184"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46350@debbugs.gnu.org To: Andrey Orst Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 07 18:50:15 2021 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 1l8oCH-000926-HX for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Feb 2021 18:50:09 +0100 Original-Received: from localhost ([::1]:46000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8oCG-0004Lo-Kc for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Feb 2021 12:50:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48316) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8oCA-0004LV-Ej for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2021 12:50:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37126) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8oCA-0005r6-6N for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2021 12:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l8oCA-000798-4T for bug-gnu-emacs@gnu.org; Sun, 07 Feb 2021 12:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Feb 2021 17:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46350 X-GNU-PR-Package: emacs Original-Received: via spool by 46350-submit@debbugs.gnu.org id=B46350.161272017527432 (code B ref 46350); Sun, 07 Feb 2021 17:50:02 +0000 Original-Received: (at 46350) by debbugs.gnu.org; 7 Feb 2021 17:49:35 +0000 Original-Received: from localhost ([127.0.0.1]:48672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8oBj-00078N-FK for submit@debbugs.gnu.org; Sun, 07 Feb 2021 12:49:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l8oBh-00078B-B6 for 46350@debbugs.gnu.org; Sun, 07 Feb 2021 12:49:34 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33770) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8oBc-0005bf-2x; Sun, 07 Feb 2021 12:49:28 -0500 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1341 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l8oBb-0002Py-6I; Sun, 07 Feb 2021 12:49:27 -0500 In-Reply-To: (message from Andrey Orst on Sun, 7 Feb 2021 20:23:09 +0300) 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" Xref: news.gmane.io gmane.emacs.bugs:199524 Archived-At: > From: Andrey Orst > Date: Sun, 7 Feb 2021 20:23:09 +0300 > Cc: 46350@debbugs.gnu.org > > > Add a call to 'message' to mwheel-scroll, and have it show a counter > > that counts up? > > I've did as you've suggested. When scrolling buffer of 1405 lines from > bottom to the top (while emacs is unresponsive) mwheel-scroll function > seems to be called about ~1351 times. Single fast flick over touchpad > produces ~40 calls to mwheel-scroll. 1350 calls during what time, approximately? less than a second? I don't think Emacs can scroll so fast, one line at a time. Note that when you scroll with the scroll-bar, Emacs doesn't call scroll-up/down, it just goes to a suitably calculated buffer position. Which is why scroll-bar scrolling is much faster. But I don't see how we can do something similar with the mouse-wheel, since it doesn't allow to calculate the buffer position to go to; Emacs needs to do that calculation itself, and that what makes the scrolling so much slower. > > What is the size of the buffer that it scrolls almost instantly to > > BOB? How many lines? > > 1405 lines. I'm testing this on bundled lisp-mode.el Which explains why it scrolls in one go: 1405 ≅ 1350. So, once we've established that the touchpad injects 1-line scroll requests at such a high rate, what else needs to be investigated here?