GNU bug report logs - #29889
27.0.50; Slow visual selection

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Sujith <m.sujith@HIDDEN>; dated Fri, 29 Dec 2017 03:54:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 7 Jan 2018 17:54:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 07 12:54:14 2018
Received: from localhost ([127.0.0.1]:39822 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYF9C-0003G2-MB
	for submit <at> debbugs.gnu.org; Sun, 07 Jan 2018 12:54:14 -0500
Received: from pmta21.teksavvy.com ([76.10.157.36]:51760)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1eYF9A-0003Fo-0g
 for 29889 <at> debbugs.gnu.org; Sun, 07 Jan 2018 12:54:12 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EjMgCuXVJa/yyKSC1cHAEBAQQBAQoBA?=
 =?us-ascii?q?YM/gVqJSYR6jnGCApk/CoU7AoQyQxQBAQEBAQEBAQEDaCiFJQEEAXkFCwsNJxI?=
 =?us-ascii?q?UGDGKPAi0JiECig4BAQEBAQUCASWEIIIVhm2LGgWTOZAllzwBig8oh1OXF4E8N?=
 =?us-ascii?q?iOBUDIaCDCCaIR0I4pRAQEB?=
X-IPAS-Result: =?us-ascii?q?A2EjMgCuXVJa/yyKSC1cHAEBAQQBAQoBAYM/gVqJSYR6jnG?=
 =?us-ascii?q?CApk/CoU7AoQyQxQBAQEBAQEBAQEDaCiFJQEEAXkFCwsNJxIUGDGKPAi0JiECi?=
 =?us-ascii?q?g4BAQEBAQUCASWEIIIVhm2LGgWTOZAllzwBig8oh1OXF4E8NiOBUDIaCDCCaIR?=
 =?us-ascii?q?0I4pRAQEB?=
X-IronPort-AV: E=Sophos;i="5.46,326,1511845200"; d="scan'208";a="17040924"
Received: from unknown (HELO ceviche.home) ([45.72.138.44])
 by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 07 Jan 2018 12:54:05 -0500
Received: by ceviche.home (Postfix, from userid 20848)
 id A10F166326; Sun,  7 Jan 2018 12:54:05 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29889: 27.0.50; Slow visual selection
Message-ID: <jwvk1wtzher.fsf-monnier+emacsbugs@HIDDEN>
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN>
 <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
 <1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN>
 <87608fwzx1.fsf@HIDDEN> <83incf9ydr.fsf@HIDDEN>
 <jwvzi5r0zza.fsf-monnier+emacsbugs@HIDDEN> <834lnz9d3h.fsf@HIDDEN>
 <5A5245FC.4080309@HIDDEN> <83h8rx8tbz.fsf@HIDDEN>
Date: Sun, 07 Jan 2018 12:54:05 -0500
In-Reply-To: <83h8rx8tbz.fsf@HIDDEN> (Eli Zaretskii's message of "Sun, 07 Jan
 2018 19:36:00 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 29889
Cc: martin rudalics <rudalics@HIDDEN>, 29889 <at> debbugs.gnu.org,
 m.sujith@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

> Yes.  However, I don't feel I can defend the change of the default
> value in Emacs 26, unless I hear more support from developers.

I don't have a strong opinion either way:
- on the one hand, it seems very harmless in terms of the risk to break
  existing Elisp packages: the change should only affect
  interactive behavior.
- on the other hand, we lived with this for 2 years now, so it's not
  terribly urgent.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 7 Jan 2018 17:36:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 07 12:36:28 2018
Received: from localhost ([127.0.0.1]:39810 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYEs0-0002rp-JR
	for submit <at> debbugs.gnu.org; Sun, 07 Jan 2018 12:36:28 -0500
Received: from eggs.gnu.org ([208.118.235.92]:35169)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eYErz-0002rc-19
 for 29889 <at> debbugs.gnu.org; Sun, 07 Jan 2018 12:36:27 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eYErt-0007LF-79
 for 29889 <at> debbugs.gnu.org; Sun, 07 Jan 2018 12:36:22 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44770)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eYErm-0007Ap-GQ; Sun, 07 Jan 2018 12:36:14 -0500
Received: from [176.228.60.248] (port=1665 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1eYErl-0002q4-Vq; Sun, 07 Jan 2018 12:36:14 -0500
Date: Sun, 07 Jan 2018 19:36:00 +0200
Message-Id: <83h8rx8tbz.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
In-reply-to: <5A5245FC.4080309@HIDDEN> (message from martin rudalics on Sun,
 07 Jan 2018 17:08:28 +0100)
Subject: Re: bug#29889: 27.0.50; Slow visual selection
References: <87y3lmgphl.fsf@HIDDEN>
 <83tvw9gb26.fsf@HIDDEN>	<87efndro8q.fsf@HIDDEN>
 <837et4fraf.fsf@HIDDEN>	<87wp13h3jn.fsf@HIDDEN>	<724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>	<1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN>	<87608fwzx1.fsf@HIDDEN>
 <83incf9ydr.fsf@HIDDEN>	<jwvzi5r0zza.fsf-monnier+emacsbugs@HIDDEN>
 <834lnz9d3h.fsf@HIDDEN> <5A5245FC.4080309@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org, monnier@HIDDEN, m.sujith@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date: Sun, 07 Jan 2018 17:08:28 +0100
> From: martin rudalics <rudalics@HIDDEN>
> CC: 29889 <at> debbugs.gnu.org, m.sujith@HIDDEN
> 
>  > 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.
> 
> See also Bug#29661.

Yes.  However, I don't feel I can defend the change of the default
value in Emacs 26, unless I hear more support from developers.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 7 Jan 2018 16:08:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 07 11:08:49 2018
Received: from localhost ([127.0.0.1]:39762 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYDVB-0000oE-0H
	for submit <at> debbugs.gnu.org; Sun, 07 Jan 2018 11:08:49 -0500
Received: from mout.gmx.net ([212.227.17.20]:55846)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rudalics@HIDDEN>) id 1eYDV9-0000o0-4x
 for 29889 <at> debbugs.gnu.org; Sun, 07 Jan 2018 11:08:47 -0500
Received: from [192.168.1.100] ([212.95.5.154]) by mail.gmx.com (mrgmx103
 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MI5rO-1eay7g1cZ4-003srA; Sun, 07
 Jan 2018 17:08:34 +0100
Message-ID: <5A5245FC.4080309@HIDDEN>
Date: Sun, 07 Jan 2018 17:08:28 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Eli Zaretskii <eliz@HIDDEN>, 
 Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#29889: 27.0.50; Slow visual selection
References: <87y3lmgphl.fsf@HIDDEN>
 <83tvw9gb26.fsf@HIDDEN>	<87efndro8q.fsf@HIDDEN>
 <837et4fraf.fsf@HIDDEN>	<87wp13h3jn.fsf@HIDDEN>	<724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>	<1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN>	<87608fwzx1.fsf@HIDDEN>
 <83incf9ydr.fsf@HIDDEN>	<jwvzi5r0zza.fsf-monnier+emacsbugs@HIDDEN>
 <834lnz9d3h.fsf@HIDDEN>
In-Reply-To: <834lnz9d3h.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:ymL0iuamNYsCZtfQPOlnylsuUwEtP9hTmAb3S3kA8Z7DgdtuSz2
 5cZnef/0pai3aHl6+fcB0JlnBxJMv6T5Fo0ljFlK3QfDGhFOpios5qI7ewfVSexRRC9ZOay
 xUswnjO3lVWx01tXUj7AsnmQAKJcM94JUWbgwt9M+oz84OSQqQOHjr1OM/0RAVn0Ps6OFlW
 3zK+K7zawffLGDnjwDEdA==
X-UI-Out-Filterresults: notjunk:1;V01:K0:+tq0arCe2kI=:6qt+tNo5xaz62WkWLVUVNZ
 SneyIn+UsH5xzHiqiJD1j/1jZqGrwSM34E0Y0YVYDz7DwgMOi+LiVNbWT/B+gRkQrmips3nBL
 Fjk2yfwE5oI9raJMJ84GW+tQ4Fh2bkXl1qLvlRWz60O5P/Ly98PND8CDRiCwHoC3EtfNpLr+K
 4aNS2hmnqxxoMmUI58EvwvD+MIsJ9MrkEadCc7mJPbq9X0vnPO7XhcbHo5NN9FcHtgunhXXvw
 Ks+wE+vlg/xvCA76kHjp6xuoz8IcPx8+Tk64hMc3qFjtqmCnDVvoDytMY2sjg+XHqOjVgkWvc
 qllfomlL8fLab7/Q1h58eW3clGR7V6s2tP06eBqs/HJVArZQ1V4HS4Putmm1z/NUsLMage4uj
 yelTOZW/QJumzDWFwlEp6FtnVvyawODP0KONKXKdXZCBSup1JkamMQW3Sy00d7t2lT7bb5mZY
 irch1Pz/vlCSWB/61ciQxx2L5Frng759mpLsNHQKn3kCSy45IXs57QQSb34Pg54BGTpZwQKDK
 zK/Aiz4PrpkkprwjAVPcmBO3u6Ty4StRkDGo9VOPsNx05KeNFSY7RQquTTAz8kA4Av9pFEAPs
 d5R3D6fi/IiDRdfeBiWit605wZwD0BhEYej+yojj645XfEDHoRT7DBTpPbYU+SasD8JmLB0sX
 MQbNKMHpbrn2NPK11BgSliWcje2eCjxX0SjvOZpE8L6Gr9QRzEb2U09vtiUPsvWDhDr+0uTSX
 h7qdp482RUy984MgzoiTn7MF+aZX+Pn577W5yAWJHPKwrJcpwn5PPWd5f+4RW6DGXlpyonMdh
 VwuINfUiIM0Lou7k29b80hC6c0ywRB14XDijCTd85w5yNaziS6vRg2MqoqosPncdeEmgO2P
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org, m.sujith@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

 > 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.

See also Bug#29661.

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 7 Jan 2018 15:24:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jan 07 10:24:07 2018
Received: from localhost ([127.0.0.1]:39743 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eYCnv-0008FI-KI
	for submit <at> debbugs.gnu.org; Sun, 07 Jan 2018 10:24:07 -0500
Received: from pmta11.teksavvy.com ([76.10.157.34]:47811)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1eYCnv-0008Ev-43
 for 29889 <at> debbugs.gnu.org; Sun, 07 Jan 2018 10:24:07 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EBjQCqOlJa/yyKSC1cHAEBAQQBAQoBA?=
 =?us-ascii?q?YM/gVqJSYR6jnGCApk/hUUChDJDFAEBAQEBAQEBAQNoKIUlAQQBeQULCw0nEhQ?=
 =?us-ascii?q?YMYo8CLQAIQKKDQEBAQEBBQIBJYY1hm2LGgWTOYY2iW+LfItAAYoPKIdTmFM2I?=
 =?us-ascii?q?4FQMhoIMD2CK4R0I4pOAQEB?=
X-IPAS-Result: =?us-ascii?q?A2EBjQCqOlJa/yyKSC1cHAEBAQQBAQoBAYM/gVqJSYR6jnG?=
 =?us-ascii?q?CApk/hUUChDJDFAEBAQEBAQEBAQNoKIUlAQQBeQULCw0nEhQYMYo8CLQAIQKKD?=
 =?us-ascii?q?QEBAQEBBQIBJYY1hm2LGgWTOYY2iW+LfItAAYoPKIdTmFM2I4FQMhoIMD2CK4R?=
 =?us-ascii?q?0I4pOAQEB?=
Subject: [SUSPECTED SPAM] Re: bug#29889: 27.0.50; Slow visual selection
X-IronPort-AV: E=Sophos;i="5.46,326,1511845200"; d="scan'208";a="17569132"
Received: from unknown (HELO pastel.home) ([45.72.138.44])
 by smtp.teksavvy.com with ESMTP; 07 Jan 2018 10:24:01 -0500
Received: by pastel.home (Postfix, from userid 20848)
 id 7E8B96049F; Sun,  7 Jan 2018 10:24:01 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Message-ID: <jwvvagdzobo.fsf-monnier+emacsbugs@HIDDEN>
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN>
 <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
 <1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN>
 <87608fwzx1.fsf@HIDDEN> <83incf9ydr.fsf@HIDDEN>
 <jwvzi5r0zza.fsf-monnier+emacsbugs@HIDDEN> <834lnz9d3h.fsf@HIDDEN>
Date: Sun, 07 Jan 2018 10:24:01 -0500
In-Reply-To: <834lnz9d3h.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 06 Jan
 2018 18:16:50 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org, m.sujith@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

> But do we have a way of "adjusting" a string like that?

I was thinking of storing the "selected text" not as a single string but
a list of "operations" (from which we could generate the actual string
upon request).

> That sounds cleaner to me.  Also much easier to implement.

I think so too (I wrote them in the order in which they occurred to me).

> But it can only be done on master, I think.

Definitely.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 6 Jan 2018 16:17:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 06 11:17:22 2018
Received: from localhost ([127.0.0.1]:38330 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eXr9u-0006lm-3x
	for submit <at> debbugs.gnu.org; Sat, 06 Jan 2018 11:17:22 -0500
Received: from eggs.gnu.org ([208.118.235.92]:38832)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eXr9t-0006la-3o
 for 29889 <at> debbugs.gnu.org; Sat, 06 Jan 2018 11:17:21 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eXr9j-0004OX-OV
 for 29889 <at> debbugs.gnu.org; Sat, 06 Jan 2018 11:17:15 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54229)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eXr9j-0004Nn-Ku; Sat, 06 Jan 2018 11:17:11 -0500
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 <eliz@HIDDEN>)
 id 1eXr9i-0003fn-Dq; Sat, 06 Jan 2018 11:17:11 -0500
Date: Sat, 06 Jan 2018 18:16:50 +0200
Message-Id: <834lnz9d3h.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwvzi5r0zza.fsf-monnier+emacsbugs@HIDDEN> (message from Stefan
 Monnier on Sat, 06 Jan 2018 10:37:27 -0500)
Subject: Re: bug#29889: 27.0.50; Slow visual selection
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN>
 <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
 <1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN>
 <87608fwzx1.fsf@HIDDEN> <83incf9ydr.fsf@HIDDEN>
 <jwvzi5r0zza.fsf-monnier+emacsbugs@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org, m.sujith@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Stefan Monnier <monnier@HIDDEN>
> Cc: Sujith <m.sujith@HIDDEN>,  29889 <at> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 6 Jan 2018 15:47:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 06 10:47:28 2018
Received: from localhost ([127.0.0.1]:38293 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eXqgy-00064X-7B
	for submit <at> debbugs.gnu.org; Sat, 06 Jan 2018 10:47:28 -0500
Received: from mail-pf0-f182.google.com ([209.85.192.182]:46765)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.sujith@HIDDEN>) id 1eXqgx-00064L-83
 for 29889 <at> debbugs.gnu.org; Sat, 06 Jan 2018 10:47:27 -0500
Received: by mail-pf0-f182.google.com with SMTP id c204so3441462pfc.13
 for <29889 <at> debbugs.gnu.org>; Sat, 06 Jan 2018 07:47:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=9EfE9T19SeBAOVDLp8TN+3jpacsNI9mxQ27YpqIEUV8=;
 b=XAmvO8yFW0Po98EztyrDf6svRt5+BFTQV5CDdN1mzz6FjDnhP/6a+MVRdZRJbeKs4g
 JPkZqP5F9kICoaIvX0z/e5ASNFWFrkIuFtGV9Ksfd7nrP24Y8upNgaAYbRM5Z1lC1UTS
 ZVGNsMMYFRrywcVRXNQzb4X4akxj0yjXSVvhrnkgSA0kB25DbbLKfEwBaucuT9KT+JrU
 kpwQxfP2LcQ1V2FJRI58lJn/vCz9IKz8kXyehXEQNB05OHDvwSVB8xAoO+SYELd4OxbO
 qxa957w/sx0S6q0tZROthjoH3RUBp9PIwfJD2ywSo7p5Q2m1BLVTpgVRqJ8p1Duf2HJM
 peNA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version;
 bh=9EfE9T19SeBAOVDLp8TN+3jpacsNI9mxQ27YpqIEUV8=;
 b=oC5jeRjf/3AUV5PpbD6KgslEF+ep1lcJiIhN5u6q1v4a89K0aXt/Q+aajSuI0hCNDu
 NYBx/fM4OKgzM5grDpJ/tuT6GvwEl2af6Ilwv7HMyHpn7/E7s45/CvNrgcjU+y5KAigj
 y6rKny90M72EzqTrGCgq6+kZ6nLZGSfaf/V1M+XbHIPfb6sP38icTNgNLB43mPEYs0Lp
 P7ezDpR9MyHkdTL+cDup6I1ULF0IT75F6QYVpG50jV4TrWdWPD/7hiM7qsMqg10c4RLQ
 qHxrdsdDw4OlT6Pfy0C1Jc2Iis10Pn4dIhd54xtXY32v+wUASFTbbANSYIcCPpaVOdLL
 ghsw==
X-Gm-Message-State: AKGB3mLz2HP0sRdS99xXNS5eGc7vp/WBReKXfQoITbgyOTaC6QP3I6ZI
 V/fG0vV98yodvc0jr6inP3PI5wyT
X-Google-Smtp-Source: ACJfBov5sHjH9uzOPkZbWvKSpszNBF5H9uM+0Nq3gpDCxbu+6vihilqnTra51OXdP+Zu2q+sel1ziA==
X-Received: by 10.99.116.22 with SMTP id p22mr1420950pgc.4.1515253640544;
 Sat, 06 Jan 2018 07:47:20 -0800 (PST)
Received: from the-damned ([117.249.218.213])
 by smtp.gmail.com with ESMTPSA id n65sm18163797pfa.83.2018.01.06.07.47.16
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Sat, 06 Jan 2018 07:47:20 -0800 (PST)
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN> <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
 <1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN> <87608fwzx1.fsf@HIDDEN>
 <83incf9ydr.fsf@HIDDEN>
User-agent: mu4e 0.9.18; emacs 27.0.50
From: Sujith <m.sujith@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29889: 27.0.50; Slow visual selection
In-reply-to: <83incf9ydr.fsf@HIDDEN>
Date: Sat, 06 Jan 2018 21:16:52 +0530
Message-ID: <87608fyopf.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org, monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Eli Zaretskii <eliz@HIDDEN> writes:
> That would be my recommendation, yes.  Especially if you happen to
> deal frequently with large regions, and you did not disable
> transient-mark-mode.

I select large regions to run 'clang-format-region' to cleanup
code in a preferred format, so I can see this quite frequently.

Thanks for looking into this.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 6 Jan 2018 15:37:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 06 10:37:34 2018
Received: from localhost ([127.0.0.1]:38288 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eXqXO-0005qz-7Y
	for submit <at> debbugs.gnu.org; Sat, 06 Jan 2018 10:37:34 -0500
Received: from pmta31.teksavvy.com ([76.10.157.38]:60818)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1eXqXN-0005qm-0Y
 for 29889 <at> debbugs.gnu.org; Sat, 06 Jan 2018 10:37:33 -0500
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2GjMAAg7FBa/yyKSC1bHAEBAQQBAQoBA?=
 =?us-ascii?q?YMPMIFaiUmEeo50ggKZP4VFAoQyQxQBAQEBAQEBAQEDaCiFJQEEAXkFCwsNJxI?=
 =?us-ascii?q?UGDGKPAiuP4MoIQKKEQEBAQEBBQIBJYQgghWGbYsaBZM5kCWhTCiHU5hTNiOBU?=
 =?us-ascii?q?DIaCDCCaIR0I4pNAQEB?=
X-IPAS-Result: =?us-ascii?q?A2GjMAAg7FBa/yyKSC1bHAEBAQQBAQoBAYMPMIFaiUmEeo5?=
 =?us-ascii?q?0ggKZP4VFAoQyQxQBAQEBAQEBAQEDaCiFJQEEAXkFCwsNJxIUGDGKPAiuP4MoI?=
 =?us-ascii?q?QKKEQEBAQEBBQIBJYQgghWGbYsaBZM5kCWhTCiHU5hTNiOBUDIaCDCCaIR0I4p?=
 =?us-ascii?q?NAQEB?=
X-IronPort-AV: E=Sophos;i="5.46,322,1511845200"; d="scan'208";a="16923811"
Received: from unknown (HELO pastel.home) ([45.72.138.44])
 by smtp.teksavvy.com with ESMTP; 06 Jan 2018 10:37:27 -0500
Received: by pastel.home (Postfix, from userid 20848)
 id 3013361839; Sat,  6 Jan 2018 10:37:27 -0500 (EST)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29889: 27.0.50; Slow visual selection
Message-ID: <jwvzi5r0zza.fsf-monnier+emacsbugs@HIDDEN>
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN>
 <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
 <1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN>
 <87608fwzx1.fsf@HIDDEN> <83incf9ydr.fsf@HIDDEN>
Date: Sat, 06 Jan 2018 10:37:27 -0500
In-Reply-To: <83incf9ydr.fsf@HIDDEN> (Eli Zaretskii's message of "Sat, 06 Jan
 2018 10:37:04 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org, Sujith <m.sujith@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

> 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).

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").

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).

> Regardless, I still wonder whether region-extract-function should call
> buffer-substring-no-properties, at least when it's used to set the
> primary selection.  Stefan, any thoughts?

We could try to do that to reduce the pain a bit, but
region-extract-function should generally preserve text properties (when
its output is used by Emacs rather than by another application), so we'd
need to add some way to specify whether we want the properties or not.
I think I'd rather "fix it right" than add such a hack.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 6 Jan 2018 08:37:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jan 06 03:37:34 2018
Received: from localhost ([127.0.0.1]:37537 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eXjyv-0000qD-Vl
	for submit <at> debbugs.gnu.org; Sat, 06 Jan 2018 03:37:34 -0500
Received: from eggs.gnu.org ([208.118.235.92]:56081)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eXjyv-0000py-3p
 for 29889 <at> debbugs.gnu.org; Sat, 06 Jan 2018 03:37:33 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eXjym-0006uB-JZ
 for 29889 <at> debbugs.gnu.org; Sat, 06 Jan 2018 03:37:27 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49176)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eXjym-0006u3-Gs; Sat, 06 Jan 2018 03:37:24 -0500
Received: from [176.228.60.248] (port=1996 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1eXjyl-0001ru-G7; Sat, 06 Jan 2018 03:37:24 -0500
Date: Sat, 06 Jan 2018 10:37:04 +0200
Message-Id: <83incf9ydr.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sujith <m.sujith@HIDDEN>
In-reply-to: <87608fwzx1.fsf@HIDDEN> (message from Sujith on Sat, 06 Jan
 2018 06:45:22 +0530)
Subject: Re: bug#29889: 27.0.50; Slow visual selection
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN> <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
 <1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN> <87608fwzx1.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org, monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Sujith <m.sujith@HIDDEN>
> Cc: bug-gnu-emacs@HIDDEN, 29889 <at> debbugs.gnu.org
> Date: Sat, 06 Jan 2018 06:45:22 +0530
> 
> I have set 'select-active-regions' to 'only' in my .emacs
> to address this issue. Is this the recommended solution for
> this problem ?

That would be my recommendation, yes.  Especially if you happen to
deal frequently with large regions, and you did not disable
transient-mark-mode.

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.

Regardless, I still wonder whether region-extract-function should call
buffer-substring-no-properties, at least when it's used to set the
primary selection.  Stefan, any thoughts?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 6 Jan 2018 01:15:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 05 20:15:49 2018
Received: from localhost ([127.0.0.1]:37448 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eXd5Q-0005QY-PE
	for submit <at> debbugs.gnu.org; Fri, 05 Jan 2018 20:15:48 -0500
Received: from mail-pg0-f68.google.com ([74.125.83.68]:33425)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.sujith@HIDDEN>) id 1eXd5P-0005QH-Pl
 for 29889 <at> debbugs.gnu.org; Fri, 05 Jan 2018 20:15:48 -0500
Received: by mail-pg0-f68.google.com with SMTP id i196so2632982pgd.0
 for <29889 <at> debbugs.gnu.org>; Fri, 05 Jan 2018 17:15:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=VBFaUgSaJtdVb2482XCxHzn3t275vW0rqPt4tl+C3s0=;
 b=bqD+889taPqaR/n9cOx7mG+zTUxWwEDt8sgBfwi2BWIiD6SH3p1SRE56UgOlZe7jBU
 TxwrXTgMJQPTmM9/JZHpzMZl9IDtVc2k9ZnTn7GpnggvB0c6X9bfL8GyKs354xjMW/vx
 0w+DsMAVt77OCVRt56Daw5wjeq3No6bBeC0qu4xxoksV8wVvNyhPSeV8oqgmXLGL8gbm
 wvV273e0coJDc5FLwmYZ/R/RpwK+SB444wFnIWiWLQjRykiYHX/4MA+pFuvtxvWrJJZe
 IeL0srN0b2DZtw2Fn/gPxv6Wi4YJOGdtxmM1mkvBZDnRC+E1jEddX0rVPFLQBIPKVUCJ
 Gdrw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version;
 bh=VBFaUgSaJtdVb2482XCxHzn3t275vW0rqPt4tl+C3s0=;
 b=C5stufhRI/u4LP+CLotTP+WQXwzS8OjPGaWizVWguplLFANacXrAAhyxcDsRa+hzt5
 rxQmUUhhzwBph7C5l497d1J31cnNdT7yqDY0rRwdiyZZrfSCtKD/Fi4kBc8mQ69ra1D7
 tfvSFdJIVnUE4ENmrL9/XgqaX6Y9WWfOAjyLWJ/uEUMqZnQBXlOH9gOgI1X1ROd0l41m
 LASl3g6W7GW/0BHd808IWDsZEhRn9deTHIfYqJHi1fSB1WK0KTBRLEpTskdE2fHq8I9v
 Tx/N5gECFpkpxz0dePOd+oA6jAXDbaqslWjMyYm/p0S9U8YQcxS6WkTqTwBujkfd4clK
 3DxQ==
X-Gm-Message-State: AKGB3mJ3g0wRyhf3i3Oj333HcVXAS7UYVbt45FTZlTUl7m0ZrfgaMUBv
 cowqaRz1qAD43CDISaEjSv7W3Cdt
X-Google-Smtp-Source: ACJfBovyW7rzK2X+UsYxjbUdop/so5j32Kqr4F64Ppn6jt2d6TvTyNAhBOSucTltoktw8PUP+N1WbQ==
X-Received: by 10.99.56.8 with SMTP id f8mr3891435pga.438.1515201341422;
 Fri, 05 Jan 2018 17:15:41 -0800 (PST)
Received: from the-damned ([117.251.224.118])
 by smtp.gmail.com with ESMTPSA id b8sm11570630pgt.14.2018.01.05.17.15.38
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Fri, 05 Jan 2018 17:15:40 -0800 (PST)
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN> <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
 <1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN>
User-agent: mu4e 0.9.18; emacs 27.0.50
From: Sujith <m.sujith@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#29889: 27.0.50; Slow visual selection
In-reply-to: <1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN>
Date: Sat, 06 Jan 2018 06:45:22 +0530
Message-ID: <87608fwzx1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 29889
Cc: bug-gnu-emacs@HIDDEN, 29889 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

I have set 'select-active-regions' to 'only' in my .emacs
to address this issue. Is this the recommended solution for
this problem ?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 6 Jan 2018 01:15:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jan 05 20:15:55 2018
Received: from localhost ([127.0.0.1]:37451 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eXd5X-0005Qs-15
	for submit <at> debbugs.gnu.org; Fri, 05 Jan 2018 20:15:55 -0500
Received: from eggs.gnu.org ([208.118.235.92]:43486)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.sujith@HIDDEN>) id 1eXd5W-0005QZ-0j
 for submit <at> debbugs.gnu.org; Fri, 05 Jan 2018 20:15:54 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <m.sujith@HIDDEN>) id 1eXd5Q-0005GP-06
 for submit <at> debbugs.gnu.org; Fri, 05 Jan 2018 20:15:48 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:49442)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <m.sujith@HIDDEN>) id 1eXd5P-0005FR-Jz
 for submit <at> debbugs.gnu.org; Fri, 05 Jan 2018 20:15:47 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:34400)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <m.sujith@HIDDEN>) id 1eXd5O-0005v7-Om
 for bug-gnu-emacs@HIDDEN; Fri, 05 Jan 2018 20:15:47 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <m.sujith@HIDDEN>) id 1eXd5L-00059V-HX
 for bug-gnu-emacs@HIDDEN; Fri, 05 Jan 2018 20:15:46 -0500
Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:44640)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <m.sujith@HIDDEN>)
 id 1eXd5L-000583-0d; Fri, 05 Jan 2018 20:15:43 -0500
Received: by mail-pg0-x241.google.com with SMTP id i5so2627212pgq.11;
 Fri, 05 Jan 2018 17:15:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=VBFaUgSaJtdVb2482XCxHzn3t275vW0rqPt4tl+C3s0=;
 b=bqD+889taPqaR/n9cOx7mG+zTUxWwEDt8sgBfwi2BWIiD6SH3p1SRE56UgOlZe7jBU
 TxwrXTgMJQPTmM9/JZHpzMZl9IDtVc2k9ZnTn7GpnggvB0c6X9bfL8GyKs354xjMW/vx
 0w+DsMAVt77OCVRt56Daw5wjeq3No6bBeC0qu4xxoksV8wVvNyhPSeV8oqgmXLGL8gbm
 wvV273e0coJDc5FLwmYZ/R/RpwK+SB444wFnIWiWLQjRykiYHX/4MA+pFuvtxvWrJJZe
 IeL0srN0b2DZtw2Fn/gPxv6Wi4YJOGdtxmM1mkvBZDnRC+E1jEddX0rVPFLQBIPKVUCJ
 Gdrw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version;
 bh=VBFaUgSaJtdVb2482XCxHzn3t275vW0rqPt4tl+C3s0=;
 b=UP5edSOUjEDQXRr5lypjT48Y1brSkfh/s9wKmZUr3LxBnXERVsHwmkj/NmjE0z2ELg
 7/feR4RC9Xz2gPxIgUZUnLYkfZPRc29knMdEabyjuamGpJjROzRYW5YI+Tnn0YvGgTGl
 mmkUGDL0sj/QBzvHL5t0QZno2EcYT1aMhFKTHYnfT64VwvKyjBb4EntUT73BtqxsUmAd
 Hl4vWzrW8zdqEtO+oMrc7B0TomMj0Lg/8i1bHEuwNYVuP/SYEH7uKR3R8CrijwJp4WxL
 lzdyma/oKHy/OhOR7eXSuJeGf/OkdFGu5PGQBbJeA8u1KNmWrMERLYLe3hzjo3aYzyoi
 r7Qg==
X-Gm-Message-State: AKGB3mIptyTyrenjNnGVFHHJ/mSxCwTg61F4JPOKw7PdDJt7bxWXye0H
 ahJ9vBSsapAGoovDXixE0HP9Cia9
X-Google-Smtp-Source: ACJfBovyW7rzK2X+UsYxjbUdop/so5j32Kqr4F64Ppn6jt2d6TvTyNAhBOSucTltoktw8PUP+N1WbQ==
X-Received: by 10.99.56.8 with SMTP id f8mr3891435pga.438.1515201341422;
 Fri, 05 Jan 2018 17:15:41 -0800 (PST)
Received: from the-damned ([117.251.224.118])
 by smtp.gmail.com with ESMTPSA id b8sm11570630pgt.14.2018.01.05.17.15.38
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Fri, 05 Jan 2018 17:15:40 -0800 (PST)
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN> <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
 <1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN>
User-agent: mu4e 0.9.18; emacs 27.0.50
From: Sujith <m.sujith@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#29889: 27.0.50; Slow visual selection
In-reply-to: <1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN>
Date: Sat, 06 Jan 2018 06:45:22 +0530
Message-ID: <87608fwzx1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
Cc: bug-gnu-emacs@HIDDEN, 29889 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

I have set 'select-active-regions' to 'only' in my .emacs
to address this issue. Is this the recommended solution for
this problem ?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 31 Dec 2017 18:44:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 31 13:44:09 2017
Received: from localhost ([127.0.0.1]:59007 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eViaf-0006lY-5T
	for submit <at> debbugs.gnu.org; Sun, 31 Dec 2017 13:44:09 -0500
Received: from eggs.gnu.org ([208.118.235.92]:60991)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eViad-0006lK-W3
 for 29889 <at> debbugs.gnu.org; Sun, 31 Dec 2017 13:44:08 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eViaT-0004cQ-LS
 for 29889 <at> debbugs.gnu.org; Sun, 31 Dec 2017 13:44:02 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59151)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eViaT-0004cJ-Hs; Sun, 31 Dec 2017 13:43:57 -0500
Received: from [176.228.60.248] (port=2727 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1eViaS-0002Cb-Vz; Sun, 31 Dec 2017 13:43:57 -0500
Date: Sun, 31 Dec 2017 20:43:47 +0200
Message-Id: <831sjaeo0s.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: m.sujith@HIDDEN, Stefan Monnier <monnier@HIDDEN>
In-reply-to: <83h8s6ewmn.fsf@HIDDEN> (message from Eli Zaretskii on Sun, 31
 Dec 2017 17:37:52 +0200)
Subject: Re: bug#29889: 27.0.50; Slow visual selection
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN>
 <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
 <87incnqoeo.fsf@HIDDEN> <83h8s6ewmn.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> Date: Sun, 31 Dec 2017 17:37:52 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: 29889 <at> debbugs.gnu.org
> 
> > After doing (setq gc-cons-threshold 1000000000), the issue doesn't
> > seem to happen. The cursor moved around freely except for one
> > interruption - maybe the GC kicked in then.
> 
> Oh, you are right: if I set garbage-collection-messages non-nil, I see
> a GC message each time I move the cursor.
> 
> So I guess my original theory was probably wrong, and the actual
> suspect is some code, yet to be discovered, that conses such large
> amounts of Lisp data.  I will look into it if no one beats me to it.

Long story short: set select-active-regions to 'only' or nil, and the
problem goes away.

Here's what happens: select-active-regions is now t by default, since
Emacs 24.1.  When that variable is t, every command, except those in
the list selection-inhibit-update-commands (a variable that is not
documented in any manual, btw), causes us to set the primary X
selection with the text in the active region.  Doing that invokes the
value of region-extract-function, which makes a string out of the
active region, which in this case is the entire buffer text.  For a
large buffer, such as vhdl.el, this conses a large string, thus
triggering GC _on_every_keystroke_.  And that _does_ make Emacs slow.

To add insult to injury, region-extract-function calls
buffer-substring--filter, which calls buffer-substring.  In a buffer
with a lot of text properties, such as the one that is fully
fontified, this involves copying the properties from the buffer to the
newly created string, most probably just to remove the properties
right after that (because the X selection doesn't need them).  Which
explains why a fully fontified buffer made things even more slow.

So how do we resolve this issue?  Should we set select-active-regions
to 'only' by default?  Should we arrange for region-extract-function
to call buffer-substring-no-properties instead, at least in this
specific use case?  Should we do both?  Something else?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 31 Dec 2017 15:38:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 31 10:38:12 2017
Received: from localhost ([127.0.0.1]:58883 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eVfgi-0000Q2-DS
	for submit <at> debbugs.gnu.org; Sun, 31 Dec 2017 10:38:12 -0500
Received: from eggs.gnu.org ([208.118.235.92]:49421)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eVfgh-0000Pp-86
 for 29889 <at> debbugs.gnu.org; Sun, 31 Dec 2017 10:38:11 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eVfgY-0007qb-Mf
 for 29889 <at> debbugs.gnu.org; Sun, 31 Dec 2017 10:38:05 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55872)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eVfgY-0007qR-Jk; Sun, 31 Dec 2017 10:38:02 -0500
Received: from [176.228.60.248] (port=2485 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1eVfgY-0004UA-1u; Sun, 31 Dec 2017 10:38:02 -0500
Date: Sun, 31 Dec 2017 17:37:52 +0200
Message-Id: <83h8s6ewmn.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sujith <m.sujith@HIDDEN>
In-reply-to: <87incnqoeo.fsf@HIDDEN> (message from Sujith on Sun, 31 Dec
 2017 14:12:23 +0530)
Subject: Re: bug#29889: 27.0.50; Slow visual selection
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN> <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
 <87incnqoeo.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Sujith <m.sujith@HIDDEN>
> Cc: 29889 <at> debbugs.gnu.org
> Date: Sun, 31 Dec 2017 14:12:23 +0530
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> > Since mark_object appears high in the profile, could you please
> > rerun the experiment after setting gc-cons-threshold and
> > gc-cons-percentage so as to avoid GC for the time of the expdriment?
> 
> After doing (setq gc-cons-threshold 1000000000), the issue doesn't
> seem to happen. The cursor moved around freely except for one
> interruption - maybe the GC kicked in then.

Oh, you are right: if I set garbage-collection-messages non-nil, I see
a GC message each time I move the cursor.

So I guess my original theory was probably wrong, and the actual
suspect is some code, yet to be discovered, that conses such large
amounts of Lisp data.  I will look into it if no one beats me to it.

Thanks!




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 31 Dec 2017 08:43:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 31 03:43:11 2017
Received: from localhost ([127.0.0.1]:58361 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eVZD5-0003QI-HC
	for submit <at> debbugs.gnu.org; Sun, 31 Dec 2017 03:43:11 -0500
Received: from mail-pl0-f51.google.com ([209.85.160.51]:34772)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.sujith@HIDDEN>) id 1eVZD3-0003Q3-OK
 for 29889 <at> debbugs.gnu.org; Sun, 31 Dec 2017 03:43:10 -0500
Received: by mail-pl0-f51.google.com with SMTP id d21so25415766pll.1
 for <29889 <at> debbugs.gnu.org>; Sun, 31 Dec 2017 00:43:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=pn5lcLckbNBTQ53IILjzmCyDIr8eaUKj7+vdAZ3v15A=;
 b=QBvVMiboD9MQ/yvubeOMd0j2zop6n21ynXQDPDh75kD/t6K4lUXuZgR1sL65gy3jc0
 +oVK/wSWqpVP6GhTqfr9n1XByNRit+q0Off6bNspi4B9wTbFzT1QG3sP+qHxXpa3VE1t
 XggJinUvURyglSog7RghL3X1Tn6O6u2mMdgtalruoLw6NkuOqAr08NbCA8rLT8rAY5Zz
 VyDIWKdOpVqsYaBO2/J+eFlG4OU5EUaJ4mXtZAiLYh6/Ikb5Lh+um7s7JkfxfTeVvqf/
 s1j9/Fuz1ZIsjTprKhSSp9vYEKP0IyJV9aQDYu0rM1pQCfGvvQa2NN9j1HIGAQHsECYA
 wd2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version;
 bh=pn5lcLckbNBTQ53IILjzmCyDIr8eaUKj7+vdAZ3v15A=;
 b=AcgVjieSnka2hpHM7//LnuLzrKJv4G5vrKYYhY7C8c1ozmNrmFxMyuWZApYskOCb+h
 qmt6AtAQyJcQRKPf7m+q+5QIvxooftayGmTTXq1iK3dUvfoPEPypOlzRiNSFUn2F/YY4
 hAbUJrLCI4dOtzj3TriAKSdYIOpONr+ZfBlzD5NWiEDc52eWd9xOT/fkbwiCUXlkdGD6
 KtSA62PTp3813YpQnRWPsZfVQuy1nue+I6oXUb9FND9B+qEzCR7Ir2obGRX6mTeMVdzn
 D/omg7OhJZvATFnd+9OEqOK8l+L5srpbRrKYBqx7mjfTBp7e8uAiHxbzCiyxzW+6x5FL
 FyTA==
X-Gm-Message-State: AKGB3mIRMc/MbEk+JqSnEO6vdKuhA/ii2E61ZWXVmpylp/e6RgiWSQrI
 GXZg2SulXjfFSJCL3a0VtGaVRuN4
X-Google-Smtp-Source: ACJfBotiMY3Tqr3eZpx/5ooMJO0D1/k2zpc4DRINHUMyZOu41Rf9HtyvS3Zs+Bj+tqpA4baK8XI/ZA==
X-Received: by 10.84.201.6 with SMTP id u6mr40211169pld.16.1514709783182;
 Sun, 31 Dec 2017 00:43:03 -0800 (PST)
Received: from the-damned ([117.242.89.150])
 by smtp.gmail.com with ESMTPSA id a22sm86465554pfc.47.2017.12.31.00.42.58
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Sun, 31 Dec 2017 00:43:02 -0800 (PST)
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN> <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
User-agent: mu4e 0.9.18; emacs 27.0.50
From: Sujith <m.sujith@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29889: 27.0.50; Slow visual selection
In-reply-to: <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
Date: Sun, 31 Dec 2017 14:12:23 +0530
Message-ID: <87incnqoeo.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Eli Zaretskii <eliz@HIDDEN> writes:
> Since mark_object appears high in the profile, could you please
> rerun the experiment after setting gc-cons-threshold and
> gc-cons-percentage so as to avoid GC for the time of the expdriment?

After doing (setq gc-cons-threshold 1000000000), the issue doesn't
seem to happen. The cursor moved around freely except for one
interruption - maybe the GC kicked in then.

Profile report using 'perf record -p `pidof emacs`' just before
starting to move the cursor:

# Samples: 39K of event 'cycles:ppp'
# Event count (approx.): 21976730020
#
# Overhead  Command  Shared Object               Symbol                                   
# ........  .......  ..........................  .........................................
#
    35.09%  emacs    emacs-27.0.50               [.] balance_an_interval
     9.36%  emacs    emacs-27.0.50               [.] Flength
     7.38%  emacs    emacs-27.0.50               [.] lisp_align_free
     5.12%  emacs    emacs-27.0.50               [.] next_interval
     5.12%  emacs    emacs-27.0.50               [.] concat
     3.74%  emacs    emacs-27.0.50               [.] copy_intervals
     2.54%  emacs    emacs-27.0.50               [.] Fcons
     2.13%  emacs    libc-2.26.so                [.] __memmove_sse2_unaligned_erms
     1.94%  emacs    emacs-27.0.50               [.] assq_no_quit
     1.44%  emacs    emacs-27.0.50               [.] copy_properties
     1.39%  emacs    emacs-27.0.50               [.] mem_insert
     1.35%  emacs    emacs-27.0.50               [.] sweep_intervals
     1.34%  emacs    libc-2.26.so                [.] _int_malloc
     1.17%  emacs    emacs-27.0.50               [.] make_interval
     1.14%  emacs    emacs-27.0.50               [.] Fmake_list
     1.02%  emacs    emacs-27.0.50               [.] sweep_conses
     0.76%  emacs    emacs-27.0.50               [.] x_produce_glyphs
     0.76%  emacs    emacs-27.0.50               [.] split_interval_right
     0.76%  emacs    libc-2.26.so                [.] _int_free
     0.65%  emacs    emacs-27.0.50               [.] lookup_char_property
     0.61%  emacs    libc-2.26.so                [.] malloc
     0.57%  emacs    emacs-27.0.50               [.] mem_find.part.9
     0.55%  emacs    emacs-27.0.50               [.] Fcopy_sequence




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 31 Dec 2017 07:30:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 31 02:30:17 2017
Received: from localhost ([127.0.0.1]:58341 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eVY4W-0001XN-SH
	for submit <at> debbugs.gnu.org; Sun, 31 Dec 2017 02:30:17 -0500
Received: from eggs.gnu.org ([208.118.235.92]:37257)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eVY4S-0001Wt-AL
 for 29889 <at> debbugs.gnu.org; Sun, 31 Dec 2017 02:30:12 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eVY4M-0002ry-3b
 for 29889 <at> debbugs.gnu.org; Sun, 31 Dec 2017 02:30:07 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48312)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eVY4E-0002cC-5O; Sun, 31 Dec 2017 02:29:58 -0500
Received: from [176.12.216.1] (port=63875 helo=[10.160.141.254])
 by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1eVY4D-0002Ag-Dh; Sun, 31 Dec 2017 02:29:57 -0500
Date: Sun, 31 Dec 2017 09:29:53 +0200
User-Agent: K-9 Mail for Android
In-Reply-To: <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN> <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: bug#29889: 27.0.50; Slow visual selection
To: bug-gnu-emacs@HIDDEN,Sujith <m.sujith@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
Message-ID: <1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

On December 31, 2017 9:20:19 AM GMT+02:00, Eli Zaretskii <eliz@gnu=2Eorg> w=
rote:
> On December 31, 2017 7:25:32 AM GMT+02:00, Sujith <m=2Esujith@gmail=2Eco=
m>
> wrote:
> > Eli Zaretskii <eliz@gnu=2Eorg> writes:
> > > Run Emacs under 'perf' (or build with C-level profiling), and show
> > the
> > > C-level profile while moving the cursor with region highlighted?=20
> > That
> > > should tell whether my hypothesis above holds any water, and if
> not,
> > > point out some other suspects=2E
> >=20
> > I did 'perf record emacs' and then 'perf report --stdio'=2E
> >=20
> > Profile report (just the top few lines):
> >=20
> > # Overhead  Command      Shared Object               Symbol        =20
> =20
> >                            =20
> > # =2E=2E=2E=2E=2E=2E=2E=2E  =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E  =2E=2E=
=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=20
> > =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=
=2E=2E=2E=2E=2E=2E=2E=2E=2E
> > #
> >     41=2E09%  emacs        emacs-27=2E0=2E50               [=2E] mark_=
object
> > 10=2E90%  emacs        emacs-27=2E0=2E50               [=2E]
> > balance_an_interval
> >      4=2E23%  emacs        emacs-27=2E0=2E50               [=2E]
> mark_interval
> >      3=2E77%  emacs        emacs-27=2E0=2E50               [=2E] Fleng=
th
> >      3=2E45%  emacs        emacs-27=2E0=2E50               [=2E]
> sweep_strings
> >      3=2E11%  emacs        emacs-27=2E0=2E50               [=2E]
> sweep_conses
> > 2=2E94%  emacs        emacs-27=2E0=2E50               [=2E]
> > balance_intervals_internal
> >    2=2E85%  emacs        emacs-27=2E0=2E50               [=2E]
> sweep_intervals
> > 1=2E91%  emacs        emacs-27=2E0=2E50               [=2E]
> > traverse_intervals_noorder
> >    1=2E70%  emacs        emacs-27=2E0=2E50               [=2E]
> mark_char_table
> >      1=2E65%  emacs        emacs-27=2E0=2E50               [=2E]
> next_interval
> >     1=2E52%  emacs        emacs-27=2E0=2E50               [=2E]
> copy_intervals
> >      1=2E50%  emacs        emacs-27=2E0=2E50               [=2E] conca=
t
> >      1=2E43%  emacs        emacs-27=2E0=2E50               [=2E]
> sweep_vectors
> > 1=2E28%  emacs        emacs-27=2E0=2E50               [=2E]
> scan_sexps_forward
> >      0=2E93%  emacs        emacs-27=2E0=2E50               [=2E] Fcons
> >     0=2E84%  emacs        emacs-27=2E0=2E50               [=2E]
> exec_byte_code
> >      0=2E81%  emacs        emacs-27=2E0=2E50               [=2E]
> sweep_symbols
> > 0=2E72%  emacs        emacs-27=2E0=2E50               [=2E]
> > re_match_2_internal
> >=20
> >=20
> > Using gprof with --enable-profiling, the report looks like:
> >=20
> > Flat profile:
> >=20
> > Each sample counts as 0=2E01 seconds=2E
> >   %   cumulative   self              self     total          =20
> >  time   seconds   seconds    calls  ms/call  ms/call  name   =20
> >  33=2E97      6=2E33     6=2E33 111195700     0=2E00     0=2E00  mark_=
object
> > 10=2E26      8=2E24     1=2E91 31639099     0=2E00     0=2E00=20
> > balance_an_interval
> >   3=2E54      8=2E90     0=2E66 22239242     0=2E00     0=2E00  mark_i=
nterval
> > 2=2E95      9=2E45     0=2E55     7431     0=2E07     0=2E25=20
> > balance_intervals_internal
> >   2=2E79      9=2E97     0=2E52      223     2=2E33    10=2E50  sweep_=
strings
> >   2=2E42     10=2E42     0=2E45  7826133     0=2E00     0=2E00  Flengt=
h
> >   2=2E42     10=2E87     0=2E45      223     2=2E02     2=2E26  sweep_=
conses
> >   2=2E09     11=2E26     0=2E39      223     1=2E75     1=2E89=20
> sweep_intervals
> >   2=2E09     11=2E65     0=2E39   419665     0=2E00     0=2E00  assq_n=
o_quit
> >   2=2E04     12=2E03     0=2E38 11148108     0=2E00     0=2E00  next_i=
nterval
> > 1=2E93     12=2E39     0=2E36    42738     0=2E01     0=2E02=20
> scan_sexps_forward
> >   1=2E88     12=2E74     0=2E35  7482960     0=2E00     0=2E00  concat
> > 1=2E66     13=2E05     0=2E31 24810407     0=2E00     0=2E00=20
> > FETCH_MULTIBYTE_CHAR
> >   1=2E40     13=2E31     0=2E26    34595     0=2E01     0=2E01=20
> mark_char_table
> > 1=2E34     13=2E56     0=2E25     7431     0=2E03     0=2E12=20
> > traverse_intervals_noorder
> >   1=2E29     13=2E80     0=2E24   422335     0=2E00     0=2E00  exec_b=
yte_code
> >   1=2E18     14=2E02     0=2E22      223     0=2E99     1=2E14  sweep_=
vectors
> >   1=2E07     14=2E22     0=2E20      282     0=2E71     0=2E71  evxpri=
ntf
>=20
> Thanks a lot!
>=20
> Since mark_object appears high in the profile, could you please
> rerun the experiment after setting gc-cons-threshold and
> gc-cons-percentage so as to avoid GC for the time of the expdriment?

Also, please profile only when you move the cursor in the last step
of the recipe=2E  I suspect that you profiled also the time during
fontification of the buffer in step 1, otherwise I don't understand
why balance_an_interval is called so many times=2E




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 31 Dec 2017 07:30:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 31 02:30:12 2017
Received: from localhost ([127.0.0.1]:58339 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eVY4S-0001X5-H1
	for submit <at> debbugs.gnu.org; Sun, 31 Dec 2017 02:30:12 -0500
Received: from eggs.gnu.org ([208.118.235.92]:37249)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eVY4R-0001WN-57
 for submit <at> debbugs.gnu.org; Sun, 31 Dec 2017 02:30:11 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eVY4K-0002pj-Nm
 for submit <at> debbugs.gnu.org; Sun, 31 Dec 2017 02:30:05 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:46604)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <eliz@HIDDEN>) id 1eVY4K-0002pZ-KN
 for submit <at> debbugs.gnu.org; Sun, 31 Dec 2017 02:30:04 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56447)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eVY4J-00067F-Ab
 for bug-gnu-emacs@HIDDEN; Sun, 31 Dec 2017 02:30:04 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eVY4E-0002cI-9X
 for bug-gnu-emacs@HIDDEN; Sun, 31 Dec 2017 02:30:03 -0500
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48312)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eVY4E-0002cC-5O; Sun, 31 Dec 2017 02:29:58 -0500
Received: from [176.12.216.1] (port=63875 helo=[10.160.141.254])
 by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1eVY4D-0002Ag-Dh; Sun, 31 Dec 2017 02:29:57 -0500
Date: Sun, 31 Dec 2017 09:29:53 +0200
User-Agent: K-9 Mail for Android
In-Reply-To: <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN> <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: bug#29889: 27.0.50; Slow visual selection
To: bug-gnu-emacs@HIDDEN,Sujith <m.sujith@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
Message-ID: <1157A54D-2179-40FB-BE74-294304A9C550@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
Cc: 29889 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

On December 31, 2017 9:20:19 AM GMT+02:00, Eli Zaretskii <eliz@gnu=2Eorg> w=
rote:
> On December 31, 2017 7:25:32 AM GMT+02:00, Sujith <m=2Esujith@gmail=2Eco=
m>
> wrote:
> > Eli Zaretskii <eliz@gnu=2Eorg> writes:
> > > Run Emacs under 'perf' (or build with C-level profiling), and show
> > the
> > > C-level profile while moving the cursor with region highlighted?=20
> > That
> > > should tell whether my hypothesis above holds any water, and if
> not,
> > > point out some other suspects=2E
> >=20
> > I did 'perf record emacs' and then 'perf report --stdio'=2E
> >=20
> > Profile report (just the top few lines):
> >=20
> > # Overhead  Command      Shared Object               Symbol        =20
> =20
> >                            =20
> > # =2E=2E=2E=2E=2E=2E=2E=2E  =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E  =2E=2E=
=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=20
> > =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=
=2E=2E=2E=2E=2E=2E=2E=2E=2E
> > #
> >     41=2E09%  emacs        emacs-27=2E0=2E50               [=2E] mark_=
object
> > 10=2E90%  emacs        emacs-27=2E0=2E50               [=2E]
> > balance_an_interval
> >      4=2E23%  emacs        emacs-27=2E0=2E50               [=2E]
> mark_interval
> >      3=2E77%  emacs        emacs-27=2E0=2E50               [=2E] Fleng=
th
> >      3=2E45%  emacs        emacs-27=2E0=2E50               [=2E]
> sweep_strings
> >      3=2E11%  emacs        emacs-27=2E0=2E50               [=2E]
> sweep_conses
> > 2=2E94%  emacs        emacs-27=2E0=2E50               [=2E]
> > balance_intervals_internal
> >    2=2E85%  emacs        emacs-27=2E0=2E50               [=2E]
> sweep_intervals
> > 1=2E91%  emacs        emacs-27=2E0=2E50               [=2E]
> > traverse_intervals_noorder
> >    1=2E70%  emacs        emacs-27=2E0=2E50               [=2E]
> mark_char_table
> >      1=2E65%  emacs        emacs-27=2E0=2E50               [=2E]
> next_interval
> >     1=2E52%  emacs        emacs-27=2E0=2E50               [=2E]
> copy_intervals
> >      1=2E50%  emacs        emacs-27=2E0=2E50               [=2E] conca=
t
> >      1=2E43%  emacs        emacs-27=2E0=2E50               [=2E]
> sweep_vectors
> > 1=2E28%  emacs        emacs-27=2E0=2E50               [=2E]
> scan_sexps_forward
> >      0=2E93%  emacs        emacs-27=2E0=2E50               [=2E] Fcons
> >     0=2E84%  emacs        emacs-27=2E0=2E50               [=2E]
> exec_byte_code
> >      0=2E81%  emacs        emacs-27=2E0=2E50               [=2E]
> sweep_symbols
> > 0=2E72%  emacs        emacs-27=2E0=2E50               [=2E]
> > re_match_2_internal
> >=20
> >=20
> > Using gprof with --enable-profiling, the report looks like:
> >=20
> > Flat profile:
> >=20
> > Each sample counts as 0=2E01 seconds=2E
> >   %   cumulative   self              self     total          =20
> >  time   seconds   seconds    calls  ms/call  ms/call  name   =20
> >  33=2E97      6=2E33     6=2E33 111195700     0=2E00     0=2E00  mark_=
object
> > 10=2E26      8=2E24     1=2E91 31639099     0=2E00     0=2E00=20
> > balance_an_interval
> >   3=2E54      8=2E90     0=2E66 22239242     0=2E00     0=2E00  mark_i=
nterval
> > 2=2E95      9=2E45     0=2E55     7431     0=2E07     0=2E25=20
> > balance_intervals_internal
> >   2=2E79      9=2E97     0=2E52      223     2=2E33    10=2E50  sweep_=
strings
> >   2=2E42     10=2E42     0=2E45  7826133     0=2E00     0=2E00  Flengt=
h
> >   2=2E42     10=2E87     0=2E45      223     2=2E02     2=2E26  sweep_=
conses
> >   2=2E09     11=2E26     0=2E39      223     1=2E75     1=2E89=20
> sweep_intervals
> >   2=2E09     11=2E65     0=2E39   419665     0=2E00     0=2E00  assq_n=
o_quit
> >   2=2E04     12=2E03     0=2E38 11148108     0=2E00     0=2E00  next_i=
nterval
> > 1=2E93     12=2E39     0=2E36    42738     0=2E01     0=2E02=20
> scan_sexps_forward
> >   1=2E88     12=2E74     0=2E35  7482960     0=2E00     0=2E00  concat
> > 1=2E66     13=2E05     0=2E31 24810407     0=2E00     0=2E00=20
> > FETCH_MULTIBYTE_CHAR
> >   1=2E40     13=2E31     0=2E26    34595     0=2E01     0=2E01=20
> mark_char_table
> > 1=2E34     13=2E56     0=2E25     7431     0=2E03     0=2E12=20
> > traverse_intervals_noorder
> >   1=2E29     13=2E80     0=2E24   422335     0=2E00     0=2E00  exec_b=
yte_code
> >   1=2E18     14=2E02     0=2E22      223     0=2E99     1=2E14  sweep_=
vectors
> >   1=2E07     14=2E22     0=2E20      282     0=2E71     0=2E71  evxpri=
ntf
>=20
> Thanks a lot!
>=20
> Since mark_object appears high in the profile, could you please
> rerun the experiment after setting gc-cons-threshold and
> gc-cons-percentage so as to avoid GC for the time of the expdriment?

Also, please profile only when you move the cursor in the last step
of the recipe=2E  I suspect that you profiled also the time during
fontification of the buffer in step 1, otherwise I don't understand
why balance_an_interval is called so many times=2E




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 31 Dec 2017 07:20:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 31 02:20:35 2017
Received: from localhost ([127.0.0.1]:58334 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eVXv9-0001GG-EM
	for submit <at> debbugs.gnu.org; Sun, 31 Dec 2017 02:20:35 -0500
Received: from eggs.gnu.org ([208.118.235.92]:33535)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eVXv8-0001G2-AD
 for 29889 <at> debbugs.gnu.org; Sun, 31 Dec 2017 02:20:34 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eVXv1-0005f3-Lf
 for 29889 <at> debbugs.gnu.org; Sun, 31 Dec 2017 02:20:29 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48275)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eVXux-0005YL-Ae; Sun, 31 Dec 2017 02:20:23 -0500
Received: from [176.12.216.1] (port=63879 helo=[10.160.141.254])
 by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1eVXuw-0006Ao-Ja; Sun, 31 Dec 2017 02:20:23 -0500
Date: Sun, 31 Dec 2017 09:20:19 +0200
User-Agent: K-9 Mail for Android
In-Reply-To: <87wp13h3jn.fsf@HIDDEN>
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
 <87wp13h3jn.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: bug#29889: 27.0.50; Slow visual selection
To: Sujith <m.sujith@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
Message-ID: <724A6161-783D-4CAD-AFBD-40D6AEF2C6E6@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

On December 31, 2017 7:25:32 AM GMT+02:00, Sujith <m=2Esujith@gmail=2Ecom> =
wrote:
> Eli Zaretskii <eliz@gnu=2Eorg> writes:
> > Run Emacs under 'perf' (or build with C-level profiling), and show
> the
> > C-level profile while moving the cursor with region highlighted?=20
> That
> > should tell whether my hypothesis above holds any water, and if not,
> > point out some other suspects=2E
>=20
> I did 'perf record emacs' and then 'perf report --stdio'=2E
>=20
> Profile report (just the top few lines):
>=20
> # Overhead  Command      Shared Object               Symbol          =20
>                            =20
> # =2E=2E=2E=2E=2E=2E=2E=2E  =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E  =2E=2E=2E=
=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=20
> =2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=2E=
=2E=2E=2E=2E=2E=2E=2E=2E
> #
>     41=2E09%  emacs        emacs-27=2E0=2E50               [=2E] mark_ob=
ject
> 10=2E90%  emacs        emacs-27=2E0=2E50               [=2E]
> balance_an_interval
>      4=2E23%  emacs        emacs-27=2E0=2E50               [=2E] mark_in=
terval
>      3=2E77%  emacs        emacs-27=2E0=2E50               [=2E] Flength
>      3=2E45%  emacs        emacs-27=2E0=2E50               [=2E] sweep_s=
trings
>      3=2E11%  emacs        emacs-27=2E0=2E50               [=2E] sweep_c=
onses
> 2=2E94%  emacs        emacs-27=2E0=2E50               [=2E]
> balance_intervals_internal
>    2=2E85%  emacs        emacs-27=2E0=2E50               [=2E] sweep_int=
ervals
> 1=2E91%  emacs        emacs-27=2E0=2E50               [=2E]
> traverse_intervals_noorder
>    1=2E70%  emacs        emacs-27=2E0=2E50               [=2E] mark_char=
_table
>      1=2E65%  emacs        emacs-27=2E0=2E50               [=2E] next_in=
terval
>     1=2E52%  emacs        emacs-27=2E0=2E50               [=2E] copy_int=
ervals
>      1=2E50%  emacs        emacs-27=2E0=2E50               [=2E] concat
>      1=2E43%  emacs        emacs-27=2E0=2E50               [=2E] sweep_v=
ectors
> 1=2E28%  emacs        emacs-27=2E0=2E50               [=2E] scan_sexps_f=
orward
>      0=2E93%  emacs        emacs-27=2E0=2E50               [=2E] Fcons
>     0=2E84%  emacs        emacs-27=2E0=2E50               [=2E] exec_byt=
e_code
>      0=2E81%  emacs        emacs-27=2E0=2E50               [=2E] sweep_s=
ymbols
> 0=2E72%  emacs        emacs-27=2E0=2E50               [=2E]
> re_match_2_internal
>=20
>=20
> Using gprof with --enable-profiling, the report looks like:
>=20
> Flat profile:
>=20
> Each sample counts as 0=2E01 seconds=2E
>   %   cumulative   self              self     total          =20
>  time   seconds   seconds    calls  ms/call  ms/call  name   =20
>  33=2E97      6=2E33     6=2E33 111195700     0=2E00     0=2E00  mark_ob=
ject
> 10=2E26      8=2E24     1=2E91 31639099     0=2E00     0=2E00=20
> balance_an_interval
>   3=2E54      8=2E90     0=2E66 22239242     0=2E00     0=2E00  mark_int=
erval
> 2=2E95      9=2E45     0=2E55     7431     0=2E07     0=2E25=20
> balance_intervals_internal
>   2=2E79      9=2E97     0=2E52      223     2=2E33    10=2E50  sweep_st=
rings
>   2=2E42     10=2E42     0=2E45  7826133     0=2E00     0=2E00  Flength
>   2=2E42     10=2E87     0=2E45      223     2=2E02     2=2E26  sweep_co=
nses
>   2=2E09     11=2E26     0=2E39      223     1=2E75     1=2E89  sweep_in=
tervals
>   2=2E09     11=2E65     0=2E39   419665     0=2E00     0=2E00  assq_no_=
quit
>   2=2E04     12=2E03     0=2E38 11148108     0=2E00     0=2E00  next_int=
erval
> 1=2E93     12=2E39     0=2E36    42738     0=2E01     0=2E02  scan_sexps=
_forward
>   1=2E88     12=2E74     0=2E35  7482960     0=2E00     0=2E00  concat
> 1=2E66     13=2E05     0=2E31 24810407     0=2E00     0=2E00=20
> FETCH_MULTIBYTE_CHAR
>   1=2E40     13=2E31     0=2E26    34595     0=2E01     0=2E01  mark_cha=
r_table
> 1=2E34     13=2E56     0=2E25     7431     0=2E03     0=2E12=20
> traverse_intervals_noorder
>   1=2E29     13=2E80     0=2E24   422335     0=2E00     0=2E00  exec_byt=
e_code
>   1=2E18     14=2E02     0=2E22      223     0=2E99     1=2E14  sweep_ve=
ctors
>   1=2E07     14=2E22     0=2E20      282     0=2E71     0=2E71  evxprint=
f

Thanks a lot!

Since mark_object appears high in the profile, could you please
rerun the experiment after setting gc-cons-threshold and
gc-cons-percentage so as to avoid GC for the time of the expdriment?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 31 Dec 2017 05:25:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 31 00:25:57 2017
Received: from localhost ([127.0.0.1]:58292 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eVW8D-0006Ll-DE
	for submit <at> debbugs.gnu.org; Sun, 31 Dec 2017 00:25:57 -0500
Received: from mail-pl0-f50.google.com ([209.85.160.50]:38152)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.sujith@HIDDEN>) id 1eVW8C-0006LV-9M
 for 29889 <at> debbugs.gnu.org; Sun, 31 Dec 2017 00:25:56 -0500
Received: by mail-pl0-f50.google.com with SMTP id s10so25235825plj.5
 for <29889 <at> debbugs.gnu.org>; Sat, 30 Dec 2017 21:25:56 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=+c2sq+H91VFx47gGTGJU5isDoDRgf93gZv/W//DzSwo=;
 b=JzConIlPzUvRCaIohgLPrAbL0KmLIxcWHpbG9d0fy60y+jmo8k8gXT23PcoGQD46ZO
 fn93Gx8CXNLgyQg6w7Sr59+gjlRYeWPckIJMMzoruYnNwQg5P5p9pcuVSkI4MeUmFoY5
 DDDQGf2acBjiTw/sjAAGP7JXqTmSoIz8oVC++o1Dy9t0u0lujw06umY2gqdHIZCvHwv5
 WX0Ztmx6W2/K8unsT8I/nAwHVw5uc8JSS/QIMIfK3rY6zWek3LQZtYMSBKS+MHskcEyB
 4vyeoo0vikhyUmKFPXPSUO8Ea6md946+SD32qj/IqgsAXMkgFRzt0hJaQDaZkvDqZ5J/
 3NnA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version;
 bh=+c2sq+H91VFx47gGTGJU5isDoDRgf93gZv/W//DzSwo=;
 b=eV8SQw/u94Z+3tov+eaHWSEBy2O/0XFwHJrQf9ww57YBaY7AC/BqMwHcoJqEgkFyz8
 WPFIwKFeEBUrnV1eL1FlzxeR8ouNfafiPB3I8nUNA0yGYaNw65pDRDPOmduNjnBuxLmJ
 IUPXvLVsFO4wSpDtwjToi3PzKt8vnD3mbsV9DaxOkk1CZP3HYwX9/EQGRcIBJ69tP0dg
 CSd5JZSgwnW9F155MzjlObsrvMO0CcVqa7P0MfCnbxhbaGmcP2ehkz1phNKmrOA2lNcg
 DXY1fesloUc44eq8MJC/MvHiIrsLwSdSxmyyBBMOE0kkxcXzvBWw/KdAMCpa2mRPk9+H
 sUnA==
X-Gm-Message-State: AKGB3mIMsm3TwFXrXNHEqKy4ipZcQHlXYpbtziv++0Fzc2CpnSN2pt3q
 aCIsuQN5Bfcd4jtALD6ksFJupej2
X-Google-Smtp-Source: ACJfBos7C/t0SEPJ+jLD6w2qaonf0GMrU50KnE8Fe3slPnmoK5p3TTI9dmSusiiMlm6CeAgB29Rf5w==
X-Received: by 10.84.160.195 with SMTP id v3mr40645981plg.218.1514697949907;
 Sat, 30 Dec 2017 21:25:49 -0800 (PST)
Received: from the-damned ([42.111.162.161])
 by smtp.gmail.com with ESMTPSA id u19sm51016284pgv.6.2017.12.30.21.25.47
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Sat, 30 Dec 2017 21:25:49 -0800 (PST)
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN> <837et4fraf.fsf@HIDDEN>
User-agent: mu4e 0.9.18; emacs 27.0.50
From: Sujith <m.sujith@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29889: 27.0.50; Slow visual selection
In-reply-to: <837et4fraf.fsf@HIDDEN>
Date: Sun, 31 Dec 2017 10:55:32 +0530
Message-ID: <87wp13h3jn.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

Eli Zaretskii <eliz@HIDDEN> writes:
> Run Emacs under 'perf' (or build with C-level profiling), and show the
> C-level profile while moving the cursor with region highlighted?  That
> should tell whether my hypothesis above holds any water, and if not,
> point out some other suspects.

I did 'perf record emacs' and then 'perf report --stdio'.

Profile report (just the top few lines):

# Overhead  Command      Shared Object               Symbol                                        
# ........  ...........  ..........................  ................................
#
    41.09%  emacs        emacs-27.0.50               [.] mark_object
    10.90%  emacs        emacs-27.0.50               [.] balance_an_interval
     4.23%  emacs        emacs-27.0.50               [.] mark_interval
     3.77%  emacs        emacs-27.0.50               [.] Flength
     3.45%  emacs        emacs-27.0.50               [.] sweep_strings
     3.11%  emacs        emacs-27.0.50               [.] sweep_conses
     2.94%  emacs        emacs-27.0.50               [.] balance_intervals_internal
     2.85%  emacs        emacs-27.0.50               [.] sweep_intervals
     1.91%  emacs        emacs-27.0.50               [.] traverse_intervals_noorder
     1.70%  emacs        emacs-27.0.50               [.] mark_char_table
     1.65%  emacs        emacs-27.0.50               [.] next_interval
     1.52%  emacs        emacs-27.0.50               [.] copy_intervals
     1.50%  emacs        emacs-27.0.50               [.] concat
     1.43%  emacs        emacs-27.0.50               [.] sweep_vectors
     1.28%  emacs        emacs-27.0.50               [.] scan_sexps_forward
     0.93%  emacs        emacs-27.0.50               [.] Fcons
     0.84%  emacs        emacs-27.0.50               [.] exec_byte_code
     0.81%  emacs        emacs-27.0.50               [.] sweep_symbols
     0.72%  emacs        emacs-27.0.50               [.] re_match_2_internal


Using gprof with --enable-profiling, the report looks like:

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls  ms/call  ms/call  name    
 33.97      6.33     6.33 111195700     0.00     0.00  mark_object
 10.26      8.24     1.91 31639099     0.00     0.00  balance_an_interval
  3.54      8.90     0.66 22239242     0.00     0.00  mark_interval
  2.95      9.45     0.55     7431     0.07     0.25  balance_intervals_internal
  2.79      9.97     0.52      223     2.33    10.50  sweep_strings
  2.42     10.42     0.45  7826133     0.00     0.00  Flength
  2.42     10.87     0.45      223     2.02     2.26  sweep_conses
  2.09     11.26     0.39      223     1.75     1.89  sweep_intervals
  2.09     11.65     0.39   419665     0.00     0.00  assq_no_quit
  2.04     12.03     0.38 11148108     0.00     0.00  next_interval
  1.93     12.39     0.36    42738     0.01     0.02  scan_sexps_forward
  1.88     12.74     0.35  7482960     0.00     0.00  concat
  1.66     13.05     0.31 24810407     0.00     0.00  FETCH_MULTIBYTE_CHAR
  1.40     13.31     0.26    34595     0.01     0.01  mark_char_table
  1.34     13.56     0.25     7431     0.03     0.12  traverse_intervals_noorder
  1.29     13.80     0.24   422335     0.00     0.00  exec_byte_code
  1.18     14.02     0.22      223     0.99     1.14  sweep_vectors
  1.07     14.22     0.20      282     0.71     0.71  evxprintf





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 30 Dec 2017 10:23:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 30 05:23:47 2017
Received: from localhost ([127.0.0.1]:57205 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eVEIt-0004rh-AD
	for submit <at> debbugs.gnu.org; Sat, 30 Dec 2017 05:23:47 -0500
Received: from eggs.gnu.org ([208.118.235.92]:34667)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eVEIr-0004rR-AG
 for 29889 <at> debbugs.gnu.org; Sat, 30 Dec 2017 05:23:45 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eVEIh-0002JY-7p
 for 29889 <at> debbugs.gnu.org; Sat, 30 Dec 2017 05:23:40 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39797)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eVEIh-0002JN-45; Sat, 30 Dec 2017 05:23:35 -0500
Received: from [176.228.60.248] (port=4658 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1eVEIg-0008QL-KH; Sat, 30 Dec 2017 05:23:34 -0500
Date: Sat, 30 Dec 2017 12:23:20 +0200
Message-Id: <837et4fraf.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sujith <m.sujith@HIDDEN>
In-reply-to: <87efndro8q.fsf@HIDDEN> (message from Sujith on Sat, 30 Dec
 2017 07:06:05 +0530)
Subject: Re: bug#29889: 27.0.50; Slow visual selection
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
 <87efndro8q.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Sujith <m.sujith@HIDDEN>
> Cc: 29889 <at> debbugs.gnu.org
> Date: Sat, 30 Dec 2017 07:06:05 +0530
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> > Confirmed.  Additional info:
> >
> > This happens also on the emacs-26 branch and in the 26.0.90 pretest,
> > but not in Emacs 25.2.
> 
> I checked out the 'emacs-25.2' tag and the issue happens there also.

You are right.  It turns out the issue all but disappears in an
optimized build; once I rebuilt Emacs 25.3 without optimizations, I
see this in that version as well.

However, I don't seem to be able to see the problem in a -nw session,
or maybe the slowness in non-GUI frames is just below the threshold of
keeping up with the keyboard auto-repeat rate.

Starting with Emacs 25.1, we switched to using an overlay for showing
the region, so the prime suspect at this point is the relatively
expensive redisplay when buffer overlays have changed since the
previous redisplay, especially in a buffer with many text properties
(produced by font-locking).  E.g., I see that with region highlighted,
every C-f causes a full redisplay of the window, because all the other
redisplay optimizations are disabled.

> To get a valid starting point which could be seen as a 'good' commit
> for git-bisect, I tried to go back in the tree. I went up to Jun-1-2016
> and then I ran into build errors. But the issue was present at that
> point too.

This sounds consistent with the hypothesis that the overlay-based
implementation of region highlighting is the trigger.

> Anything else which I could do to help ?

Run Emacs under 'perf' (or build with C-level profiling), and show the
C-level profile while moving the cursor with region highlighted?  That
should tell whether my hypothesis above holds any water, and if not,
point out some other suspects.

Thanks.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 30 Dec 2017 01:36:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 29 20:36:33 2017
Received: from localhost ([127.0.0.1]:57079 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eV64f-0007tr-23
	for submit <at> debbugs.gnu.org; Fri, 29 Dec 2017 20:36:33 -0500
Received: from mail-pf0-f175.google.com ([209.85.192.175]:44799)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.sujith@HIDDEN>) id 1eV64d-0007tb-E7
 for 29889 <at> debbugs.gnu.org; Fri, 29 Dec 2017 20:36:31 -0500
Received: by mail-pf0-f175.google.com with SMTP id m26so22664526pfj.11
 for <29889 <at> debbugs.gnu.org>; Fri, 29 Dec 2017 17:36:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=references:user-agent:from:to:cc:subject:in-reply-to:date
 :message-id:mime-version;
 bh=agrI3jFY9qX8FAqB80IBNMyKkenxNb5ZTbiCTz+omQc=;
 b=kwrM/VX3hay1OoF8HIQGkn9HGpmpCIJJpMQ7N0apcrnB4yP7BWKXCA+tZumXlb7aEg
 OBncFEdHbIUwEr122ajWKPDI7gdG3u9zI4Mcbm35dFyl6TdFVlypSE7xTfXDPfmdJATJ
 nbw+g/6t3lH/Z8XJEBVjEn7vMoOn+IA9f3YU0weHttLb7SXFfUCQaGmaGzesFlX0aEaW
 gYKUk4zkJNWHjWGBYlFi14Vp73s6i7nQ9lowDK2gBI4qqiC6NwvYaNZgG/A6U2ftF5rz
 gLOUwIk0i4+VcbZ+bSIP+RNM6DdkvRJJlgM7LlKHe5gIlcfiylZSb7P6iT80SDfQqDMR
 gpdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:references:user-agent:from:to:cc:subject
 :in-reply-to:date:message-id:mime-version;
 bh=agrI3jFY9qX8FAqB80IBNMyKkenxNb5ZTbiCTz+omQc=;
 b=K6fc4uPqonVFkUcWkXtgO2vmXs1NYXww8XuxQRVvwFDrR+hgXKF0BnDoS2KftTC/2+
 Xj2CcEhX2LA1yBk7tocv1JSQO/ZYX1mTZ8s7vf07O4DUPezFgu7mICRcEUTyvI4ldveG
 GNhIP2POlAHqDl8wkVATIfog2gx0V3ENkZI80rzPY6yjFOS3LMreToyAo66cK1eNgIS0
 kAEw1x8qqpDv6uKhMK6B10aQUIok3CN60OetKIMwL1ptSSDcMUmCAsTnkREZ0HBPk/5T
 AZDki05VH15ZFHglsF9ccMlh3tPjjARvG3gXEAIW7Ro0Z30e5BEvvfxHc2wrW4sKpFNp
 iO3w==
X-Gm-Message-State: AKGB3mIEeqZeGey5WQhePSOH6Sv4KlILWd6AByBx+xxYTP+cD3Evha6/
 ABUGm+kPwaQVMVqP1eHbafelY1aQ
X-Google-Smtp-Source: ACJfBouOf/awzaqPGJQw+hAtekTMGGF7SM5OSO6kY6iqpIF4+5uGInTpSkdafqX6ITYE5p062IJR+g==
X-Received: by 10.99.190.10 with SMTP id l10mr24081096pgf.48.1514597784681;
 Fri, 29 Dec 2017 17:36:24 -0800 (PST)
Received: from the-damned ([117.246.81.166])
 by smtp.gmail.com with ESMTPSA id b78sm80455032pfc.21.2017.12.29.17.36.22
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Fri, 29 Dec 2017 17:36:24 -0800 (PST)
References: <87y3lmgphl.fsf@HIDDEN> <83tvw9gb26.fsf@HIDDEN>
User-agent: mu4e 0.9.18; emacs 27.0.50
From: Sujith <m.sujith@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#29889: 27.0.50; Slow visual selection
In-reply-to: <83tvw9gb26.fsf@HIDDEN>
Date: Sat, 30 Dec 2017 07:06:05 +0530
Message-ID: <87efndro8q.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Eli Zaretskii <eliz@HIDDEN> writes:
> Confirmed.  Additional info:
>
> This happens also on the emacs-26 branch and in the 26.0.90 pretest,
> but not in Emacs 25.2.

I checked out the 'emacs-25.2' tag and the issue happens there also.

To get a valid starting point which could be seen as a 'good' commit
for git-bisect, I tried to go back in the tree. I went up to Jun-1-2016
and then I ran into build errors. But the issue was present at that
point too.

Anything else which I could do to help ?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at 29889 <at> debbugs.gnu.org:


Received: (at 29889) by debbugs.gnu.org; 29 Dec 2017 09:04:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 29 04:04:28 2017
Received: from localhost ([127.0.0.1]:55755 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eUqaZ-0002ez-QU
	for submit <at> debbugs.gnu.org; Fri, 29 Dec 2017 04:04:27 -0500
Received: from eggs.gnu.org ([208.118.235.92]:43474)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1eUqaY-0002el-P2
 for 29889 <at> debbugs.gnu.org; Fri, 29 Dec 2017 04:04:26 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <eliz@HIDDEN>) id 1eUqaQ-0008Bl-VN
 for 29889 <at> debbugs.gnu.org; Fri, 29 Dec 2017 04:04:21 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37764)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1eUqaQ-0008Bh-SG; Fri, 29 Dec 2017 04:04:18 -0500
Received: from [176.228.60.248] (port=2965 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1eUqaQ-0007n6-2e; Fri, 29 Dec 2017 04:04:18 -0500
Date: Fri, 29 Dec 2017 11:04:01 +0200
Message-Id: <83tvw9gb26.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Sujith <m.sujith@HIDDEN>
In-reply-to: <87y3lmgphl.fsf@HIDDEN> (message from Sujith on Fri, 29 Dec
 2017 09:22:22 +0530)
Subject: Re: bug#29889: 27.0.50; Slow visual selection
References: <87y3lmgphl.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 29889
Cc: 29889 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: Eli Zaretskii <eliz@HIDDEN>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

> From: Sujith <m.sujith@HIDDEN>
> Date: Fri, 29 Dec 2017 09:22:22 +0530
> 
> Visual selection of text becomes very slow and hogs the
> CPU in some cases.
> 
> For example, open the file lisp/progmodes/vhdl-mode.el in
> the emacs codebase. And then, to reproduce this issue:
> 
> * Scroll patiently to the bottom using C-v.
>   (this is essential, jumping to the bottom doesn't seem to bring
>   up this issue).
> * Set mark with C-SPC.
> * Go to the beginning with M-<.
> * Now move the cursor up and down.
> 
> The selection is jerky and CPU usage is very high.
> I have tried this with emacs -Q and can see the issue. I am using
> the master branch.

Confirmed.  Additional info:

This happens also on the emacs-26 branch and in the 26.0.90 pretest,
but not in Emacs 25.2.

It also isn't limited to *.el files: I see it with, e.g., xterm.c.

The painfully slow first step can be replaced with this much simpler
step:

  M-: (font-lock-fontify-region (point-min) (point-max)) RET

I guess some bisecting is in order.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 29 Dec 2017 03:53:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 28 22:53:02 2017
Received: from localhost ([127.0.0.1]:55697 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1eUljC-0003Qp-Cr
	for submit <at> debbugs.gnu.org; Thu, 28 Dec 2017 22:53:02 -0500
Received: from eggs.gnu.org ([208.118.235.92]:54405)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <m.sujith@HIDDEN>) id 1eUljA-0003QJ-6n
 for submit <at> debbugs.gnu.org; Thu, 28 Dec 2017 22:53:00 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <m.sujith@HIDDEN>) id 1eUlj3-0006uj-Q9
 for submit <at> debbugs.gnu.org; Thu, 28 Dec 2017 22:52:55 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:47697)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <m.sujith@HIDDEN>) id 1eUlj3-0006uH-MY
 for submit <at> debbugs.gnu.org; Thu, 28 Dec 2017 22:52:53 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45363)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <m.sujith@HIDDEN>) id 1eUlj1-0006Jk-Pz
 for bug-gnu-emacs@HIDDEN; Thu, 28 Dec 2017 22:52:53 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <m.sujith@HIDDEN>) id 1eUlix-0006nF-Nn
 for bug-gnu-emacs@HIDDEN; Thu, 28 Dec 2017 22:52:51 -0500
Received: from mail-pg0-x22f.google.com ([2607:f8b0:400e:c05::22f]:38163)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <m.sujith@HIDDEN>) id 1eUlix-0006m9-EX
 for bug-gnu-emacs@HIDDEN; Thu, 28 Dec 2017 22:52:47 -0500
Received: by mail-pg0-x22f.google.com with SMTP id f12so20580401pgo.5
 for <bug-gnu-emacs@HIDDEN>; Thu, 28 Dec 2017 19:52:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=user-agent:from:to:subject:date:message-id:mime-version;
 bh=uw3zWZby98H2f0uvnHjWrpD4i7InvaIyuqSfhmwaOuM=;
 b=kY4QIUQdCYRcYU7bK4maD96VZhUDplohkdB53Fqeq0uW8Z9zwEGWSD+0qlcmnhZ7of
 XfN9v6iRinzYT/dsmm8t2LXp+0UpfDSVtwFJRU9l9uLOGiUToY14WK9a0j4UGqmatQQ3
 LEC3HFXfA5e+BxE0ZSr9gam5fPnzESMYnW1jJGXVDPaW+F3Oj3vtia73cUeCtla9tOB+
 Spqn5rQiNGnHlH+Jc9LLsBTe1eBeXQ2d7UfqpphUCxglPRaP1axTKWM7fn1GVJtkN1wM
 0VKW9rGqYInycXgE8+nR1Vq+FRkvOej/5+7flErzZvs1fmFPrulSqs8lTWhPTKk74K+u
 R8HQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:user-agent:from:to:subject:date:message-id
 :mime-version;
 bh=uw3zWZby98H2f0uvnHjWrpD4i7InvaIyuqSfhmwaOuM=;
 b=DeFARjj+D0OY5suHObfMvdTtYKSz8cLNc9mKR4sxAdPYXSjiKTLKwPZE1UCqINV8Rx
 xdzQAm3UnbtYyjbMg3YF+4ENEID0l2WzVuTPDMU8v/K4FNTWtkdGsbHTVmTI9H3GWpBj
 yoTH8k07MNx/KXZiSrRzAAQouFgYrJSmIY6VqsdzWco+hWFvJH7YaXKiFpGjVaSNlLWI
 fcC5/0JMhKQpH5CgFRTI8T6mbUmmFrBvw4dAL5Sku/fkf1qpFzNWKY1awPcMqKj3dv7u
 Qa12rnb+UL+GZ7KcCE6WUts/RMUkRgktshLVAVrRL4VuWVW4n/alrwPYWT/zwbu0Qpep
 ehBw==
X-Gm-Message-State: AKGB3mKe6BEw0ETyVW2YDTL5UwlyRy1gs+GKuBPK28QK42vlK6fWOtj4
 j0sCKp2mq+r4SbIyz+CXcmcEjQAq
X-Google-Smtp-Source: ACJfBouUeqLdx8s4WKAWnNJm+x27Hqf8xbv4Qr48C5F0UacYh8EpQQQbkIGj0SBAHdk301GiI954HQ==
X-Received: by 10.99.181.24 with SMTP id y24mr29271927pge.270.1514519565345;
 Thu, 28 Dec 2017 19:52:45 -0800 (PST)
Received: from the-damned ([117.246.32.145])
 by smtp.gmail.com with ESMTPSA id f67sm69719665pff.173.2017.12.28.19.52.42
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 28 Dec 2017 19:52:44 -0800 (PST)
User-agent: mu4e 0.9.18; emacs 27.0.50
From: Sujith <m.sujith@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 27.0.50; Slow visual selection
Date: Fri, 29 Dec 2017 09:22:22 +0530
Message-ID: <87y3lmgphl.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

Visual selection of text becomes very slow and hogs the
CPU in some cases.

For example, open the file lisp/progmodes/vhdl-mode.el in
the emacs codebase. And then, to reproduce this issue:

* Scroll patiently to the bottom using C-v.
  (this is essential, jumping to the bottom doesn't seem to bring
  up this issue).
* Set mark with C-SPC.
* Go to the beginning with M-<.
* Now move the cursor up and down.

The selection is jerky and CPU usage is very high.
I have tried this with emacs -Q and can see the issue. I am using
the master branch.

A profile report with this issue:

- #<compiled 0x41937d>                                           2499  53%
 - filter-buffer-substring                                       2499  53%
  - buffer-substring--filter                                     2499  53%
   - #<compiled 0x17002e5>                                       2499  53%
      apply                                                      2499  53%
- ...                                                            2102  44%
   Automatic GC                                                  2085  44%
 - minibuffer-complete                                             17   0%
  - completion-in-region                                           17   0%
   - completion--in-region                                         17   0%
    - #<compiled 0x10e5b45>                                        17   0%
     - apply                                                       17   0%
      - #<compiled 0x243ba7>                                       17   0%
       - completion--in-region-1                                   17   0%
        - completion--do-completion                                17   0%
         - completion-try-completion                               17   0%
          - completion--nth-completion                             17   0%
           - completion--some                                      17   0%
            - #<compiled 0x52cfb1>                                 17   0%
             - completion-basic-try-completion                     17   0%
              - try-completion                                     17   0%
               - #<compiled 0x24664f>                              17   0%
                  complete-with-action                             17   0%
+ command-execute                                                  87   1%
+ gui-set-selection                                                16   0%
+ redisplay_internal (C function)                                   3   0%


If any more information is needed, please let me know !


In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.31)
 of 2017-12-28 built on the-damned
Repository revision: b19df8ae78cdebe76512a70f76ec68677de41c11
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
Recent messages:
mwheel-scroll: Beginning of buffer [6 times]
scroll-down-command: Beginning of buffer
Undo!
uncompressing simple.el.gz...done
Note: file is write protected
uncompressing simple.el.gz...done
Note: file is write protected
scroll-down-command: Beginning of buffer [5 times]
Quit [2 times]
Making completion list...

Configured using:
 'configure --prefix=/usr --without-gconf --without-gsettings
 --without-selinux --without-gnutls --without-libsystemd
 --without-threads --without-dbus --with-x-toolkit=gtk2'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM NOTIFY ACL LIBXML2 FREETYPE
M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK2 X11 LCMS2

Important settings:
  value of $LANG: en_IN.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Shell

Minor modes in effect:
  global-magit-file-mode: t
  diff-auto-refine-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  display-time-mode: t
  iswitchb-mode: t
  savehist-mode: t
  override-global-mode: t
  save-place-mode: t
  cl-old-struct-compat-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: 1
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow flyspell ispell face-remap emacsbug cc-mode cc-fonts cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs help-fns
radix-tree find-func profiler dired-aux elec-pair mu4e-alert pcase ht s
alert log4e rx notifications dbus xml gntp magit-obsolete magit-blame
magit-stash magit-bisect magit-remote magit-commit magit-sequence
magit-notes magit-worktree magit-branch magit-collab ghub url-auth url
url-proxy url-privacy url-expand url-methods url-history url-cookie
url-domsuf url-util mailcap let-alist magit-files magit-refs
magit-status magit magit-repos magit-apply magit-wip magit-log
magit-diff smerge-mode diff-mode magit-core magit-autorevert autorevert
filenotify magit-process magit-margin magit-mode git-commit magit-git
magit-section magit-utils crm magit-popup log-edit pcvs-util add-log
with-editor cl-extra help-mode async-bytecomp async shell pcomplete dash
advice mu4e-contrib mu4e desktop frameset mu4e-speedbar speedbar
sb-image ezimage dframe mu4e-main mu4e-context mu4e-view cal-menu
calendar cal-loaddefs thingatpt browse-url comint ansi-color
mu4e-headers mu4e-compose mu4e-draft mu4e-actions ido rfc2368 smtpmail
sendmail mu4e-mark mu4e-message html2text mu4e-proc mu4e-utils doc-view
jka-compr image-mode mu4e-lists mu4e-vars message rmc puny format-spec
rfc822 mml mml-sec epa derived epg gnus-util rmail rmail-loaddefs
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util
ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader hl-line
cl mu4e-meta battery time dired-x dired dired-loaddefs edmacro kmacro
xcscope ring zenburn-theme server iswitchb savehist bind-key easy-mmode
saveplace finder-inf info package easymenu epg-config url-handlers
url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json map url-vars seq byte-opt gv bytecomp byte-compile
cconv cl-loaddefs cl-lib time-date mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow isearch timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core
term/tty-colors frame cl-generic 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 charscript charprop case-table epa-hook jka-cmpr-hook
help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs
button faces cus-face macroexp files text-properties overlay sha1 md5
base64 format env code-pages mule custom widget hashtable-print-readable
backquote inotify lcms2 dynamic-setting font-render-setting move-toolbar
gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 385737 51929)
 (symbols 48 34919 1)
 (miscs 40 105 376)
 (strings 32 75656 5006)
 (string-bytes 1 2341110)
 (vectors 16 54734)
 (vector-slots 8 1167949 49516)
 (floats 8 149 357)
 (intervals 56 42540 1784)
 (buffers 992 18))




Acknowledgement sent to Sujith <m.sujith@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#29889; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.