From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#72830: Big rectangular selections are slow Date: Tue, 27 Aug 2024 18:42:19 +0200 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) 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="16205"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72830@debbugs.gnu.org, juri@linkov.net To: Stefan Monnier , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 27 18:43:26 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 1sizHx-00042l-VJ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Aug 2024 18:43:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sizHj-0001sx-Fa; Tue, 27 Aug 2024 12:43:11 -0400 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 1sizHh-0001sH-MT for bug-gnu-emacs@gnu.org; Tue, 27 Aug 2024 12:43:09 -0400 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 1sizHh-0002Yy-8Z for bug-gnu-emacs@gnu.org; Tue, 27 Aug 2024 12:43:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:Date:In-Reply-To:From:Mime-Version:To:Subject; bh=FfEcJlEidGBYK7lnaV8I5ea0VtoZ/4ye1QZkIt0FfWI=; b=PAPqV4HBPc9s0FfjyI6BigTyjxckCSs05cRVdcf87kuoiO3WUf9OeZ/2LBX2wCSAy67Uotvle8UYioL0OtbGgSTbnqBN8qi9OlBH9GBs6k3+ko0PHTcJz+tCjcs7XBBg7Oa+GCFEu0mhbjBomwLAM2B8mkd9dtPlUdDJShNXnvTNghdNo6ijA05bTtK0RPx13Mgq8YL9pAuXZhaj9AYY5XGMoG199QsUtqgl59H3lcVEWU4tBf+UjzH3kNyoKGMwJegi4/I0m9MNbw+4d4fEPRSV1agQ4D1VNXaAJstQW3/4zzbZlIRAC7Ag+hddrnwn43RguUfoQLDg6HzUWZpvKA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sizIY-0001yK-2H for bug-gnu-emacs@gnu.org; Tue, 27 Aug 2024 12:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Aug 2024 16:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72830 X-GNU-PR-Package: emacs X-Debbugs-Original-Cc: Emacs Bug Report , Juri Linkov Original-Received: via spool by submit@debbugs.gnu.org id=B.17247770127502 (code B ref -1); Tue, 27 Aug 2024 16:44:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Aug 2024 16:43:32 +0000 Original-Received: from localhost ([127.0.0.1]:47504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sizI4-0001wv-4D for submit@debbugs.gnu.org; Tue, 27 Aug 2024 12:43:32 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:50866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sizI1-0001wj-5t for submit@debbugs.gnu.org; Tue, 27 Aug 2024 12:43:30 -0400 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 1sizHA-0001oQ-3V for bug-gnu-emacs@gnu.org; Tue, 27 Aug 2024 12:42:36 -0400 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sizH2-0002XX-PR; Tue, 27 Aug 2024 12:42:35 -0400 Original-Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-533521cd1c3so6598034e87.1; Tue, 27 Aug 2024 09:42:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724776941; x=1725381741; darn=gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=FfEcJlEidGBYK7lnaV8I5ea0VtoZ/4ye1QZkIt0FfWI=; b=XFdj9+B4u9L1lTiCquUWbrET0G6Is2iD12We+euAXtXOHsiF6NLXiZ+o33PtD21oxc cuTK1tfveQzpUVoS46VoiDpGqjGp+rCWd15B9dzx1Q+A8FtijpmZAZ1RcCRlJ6RVis9b 9sHQkqYcRaNfplznsI9DXM9eR45YY6OAHieOkFK1s8cjjFFdk+zsPh0IdL24joTZvhLM DHOtyorqP5+3UztjwyJMFS5GeJWQldJDQ48hGI/x14/jJMMFH0UMQRl9sw5Z9egTmKHP cKag4BumsuDmHMybFITWn4joPOZSXNNV3V1kJ4/kWsb7s0IPhS7R4+1z5J6qVRTiMXrL mf+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724776941; x=1725381741; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=FfEcJlEidGBYK7lnaV8I5ea0VtoZ/4ye1QZkIt0FfWI=; b=HFTPnOgMUyY4zWmiVdnYN1yge1ZjkUV2dcZkOPFzNCfoiPBYPtkuNuh29f2g/3w5Tu qvIMq042Y2hs4IZ91Q7k/eGqC7NAr9slqjQbNGNuN8Pbp3FVOVT/WFwY9+qR88e3lH6B oIz6328/AavVgI7U6VPdgoQHjVTH/SuSQrnvgY0rOYPBtddEoB94FsedADGw046BPm6U 8Lk6T+G2VnfRTAkWYs2k3Kcia7utsMjcmHYu+Zik2KAO/miMlWi4dNTMT7DiYRFMIPtL STIyeDF/Y73nLOTW7n1rAGLqVst5Zg1vpU2CJzYfdjOfC1083sN/DdVRiZtchpkRcmOO yABQ== X-Forwarded-Encrypted: i=1; AJvYcCU4/vIZaSa9rN/wGxuzYG4lNBbFATPLvJa/G6QWynUV8oIOKKFpIWwTbOhK54XPDDKynfe6@gnu.org X-Gm-Message-State: AOJu0YzZXoDlVlwa3HweaGXb8uAy65N/raKi5IH6U8BBBso7EaJSY3OB T0QIKNlXsMnv7Gcucve6M5MN//siAoattFipi8prrnT064o8LWHe X-Google-Smtp-Source: AGHT+IEOknnzd2n3piNy1ee+7dTkWL8pQhYGouRMGX6Kk278xp5LT7+mux7KYmaZAA7Ka/6GTvFuQQ== X-Received: by 2002:a05:6512:23a9:b0:530:da96:a990 with SMTP id 2adb3069b0e04-53438851000mr11189577e87.32.1724776940308; Tue, 27 Aug 2024 09:42:20 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-191-82.bredband.tele2.se. [188.150.191.82]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5334ea89415sm1850976e87.285.2024.08.27.09.42.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Aug 2024 09:42:19 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.3654.120.0.1.15) Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=mattias.engdegard@gmail.com; helo=mail-lf1-x12a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:290832 Archived-At: 27 aug. 2024 kl. 15.48 skrev Eli Zaretskii : > Does turning off auto-composition-mode help in any way? I don't think so. Were you able to reproduce the problem? > Also, since highlighting is AFAIR implemented as overlays, it slows > down check_display_width, which I think would otherwise have moved > very fast if you say there are no properties and no overlays. Yes, overlays indeed seem to be at the heart of the problem. 27 aug. 2024 kl. 16.04 skrev Stefan Monnier : >> - Slow `region-beginning` and `region-end`. >> Fixed on master (3a8222e7). >=20 > Seems unlikely. It did show up on the profile, something had to be done. Before that = change, (region-beginning) with the active region as in the example took = 0.96 s on this machine. Now, maybe 30 =C2=B5s. >> - `select-active-regions` makes each selection change very expensive. >> Can be set to nil by the user, but I really suggest that we change = the >> default to nil, at least for non-X11 since the default assumes = old-school >> X11 PRIMARY selection which is alien on most other platforms. >=20 > Didn't think of that. Do we re-set the PRIMARY every time the = (active) > rectangular region is changed (i.e. after each key press)? That would > make it non-scalable to large rectangular regions, indeed. It's pretty bonkers, yes. There is even a noticeable slow-down with a = single contiguous selection. Fortunately the cure is easy. > I thought the extraction of the region's content to put it into = PRIMARY > and friends happened more lazily (e.g. when another application > requests the PRIMARY/CLIPBOARD, or when we deactivate the region). That would indeed have made some kind of sense. If confined to X11, that = is. And opt-in, even then. > I don't think we want to try and optimize the operations here because > that will only push the limit of what is "too large" a bit further. Yes, but it is educational to see what the costs are > More promising to me would be to try and skip any part of the buffer > that's not displayed. Yes, I see no reason for having the highlight overlay on something that = can't be seen.=20 But how do we know what the viewport will be in = `rectangle--highlight-for-redisplay`? Since it is redisplay that = determines window-start and window-end, and it hasn't run yet, this puts = us in some kind of chicken-egg situation. Maybe it has to be done inside = redisplay.