From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#29889: 27.0.50; Slow visual selection Date: Sat, 06 Jan 2018 18:16:50 +0200 Message-ID: <834lnz9d3h.fsf@gnu.org> References: <87y3lmgphl.fsf@gmail.com> <83tvw9gb26.fsf@gnu.org> <87efndro8q.fsf@gmail.com> <837et4fraf.fsf@gnu.org> <87wp13h3jn.fsf@gmail.com> <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@gnu.org> <1157A54D-2179-40FB-BE74-294304A9C550@gnu.org> <87608fwzx1.fsf@gmail.com> <83incf9ydr.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1515255377 29159 195.159.176.226 (6 Jan 2018 16:16:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 6 Jan 2018 16:16:17 +0000 (UTC) Cc: 29889@debbugs.gnu.org, m.sujith@gmail.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 06 17:16:12 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXr8j-00071k-2D for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Jan 2018 17:16:09 +0100 Original-Received: from localhost ([::1]:40998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXrAi-0003WF-9U for geb-bug-gnu-emacs@m.gmane.org; Sat, 06 Jan 2018 11:18:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58741) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXrAc-0003Vk-Kl for bug-gnu-emacs@gnu.org; Sat, 06 Jan 2018 11:18:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXrAY-0006Sr-F3 for bug-gnu-emacs@gnu.org; Sat, 06 Jan 2018 11:18:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57883) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXrAY-0006Sa-AY for bug-gnu-emacs@gnu.org; Sat, 06 Jan 2018 11:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eXrAY-0006ml-3U for bug-gnu-emacs@gnu.org; Sat, 06 Jan 2018 11:18: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: Sat, 06 Jan 2018 16:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29889 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 29889-submit@debbugs.gnu.org id=B29889.151525544226031 (code B ref 29889); Sat, 06 Jan 2018 16:18:02 +0000 Original-Received: (at 29889) by debbugs.gnu.org; 6 Jan 2018 16:17:22 +0000 Original-Received: from localhost ([127.0.0.1]:38330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXr9u-0006lm-3x for submit@debbugs.gnu.org; Sat, 06 Jan 2018 11:17:22 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eXr9t-0006la-3o for 29889@debbugs.gnu.org; Sat, 06 Jan 2018 11:17:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXr9j-0004OX-OV for 29889@debbugs.gnu.org; Sat, 06 Jan 2018 11:17:15 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXr9j-0004Nn-Ku; Sat, 06 Jan 2018 11:17:11 -0500 Original-Received: from [176.228.60.248] (port=2677 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eXr9i-0003fn-Dq; Sat, 06 Jan 2018 11:17:11 -0500 In-reply-to: (message from Stefan Monnier on Sat, 06 Jan 2018 10:37:27 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:141841 Archived-At: > From: Stefan Monnier > Cc: Sujith , 29889@debbugs.gnu.org > Date: Sat, 06 Jan 2018 10:37:27 -0500 > > > In fact, I cannot understand why the default was changed to t in > > 7c23dd4. The discussions leading to those changes all mention the > > value 'lazy' (later renamed to 'only') as the default, and there's > > nothing I could find explaining why t was eventually deemed a better > > default. > > FWIW I was also surprised to see its default is t rather than `only` > (and even more surprised that I hadn't noticed it all this time). So do we change it back to 'only' for Emacs 26? Sounds a bit risky to me, after it has been t for 2 major releases, with no one complaining until now. > I think to make t work well (i.e. to avoid the obvious performance issue > discussed in the current bug-report), we'd need to rework the code so as > to try and avoid re-allocating a complete brand new string all the time. > > E.g. special-case the common situation where nothing in the buffer has > been modified since last time and only extract some kind of "adjustment" > (i.e. something that says "remove last N chars" or "append this string"). But do we have a way of "adjusting" a string like that? Or did you think of a primitive that avoids consing a new string (assuming the text properties were already stripped from the string)? > Or maybe extract the region lazily: only remember the start and end > position of the region in the post-command-hook and postpone extracting > the region until either the primary selection is requested or the text > is about to be changed/destroyed (i.e. from before-change-function or > kill-buffer-hook). That sounds cleaner to me. Also much easier to implement. But it can only be done on master, I think.