From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: State of the overlay tree branch? Date: Mon, 19 Mar 2018 14:57:52 +0200 Message-ID: <83efkgnrxr.fsf@gnu.org> References: <834lldp18f.fsf@gnu.org> <9646341d-700b-4240-216b-8c0e753fa79f@arkona-technologies.de> <86d03e78-9984-f33e-a3f3-3faa4b34d78b@arkona-technologies.de> <83vadso9ad.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1521464197 21010 195.159.176.226 (19 Mar 2018 12:56:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 19 Mar 2018 12:56:37 +0000 (UTC) Cc: emacs-devel@gnu.org To: Sebastian Sturm Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 19 13:56:33 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1exuL3-0005LM-BB for ged-emacs-devel@m.gmane.org; Mon, 19 Mar 2018 13:56:33 +0100 Original-Received: from localhost ([::1]:41937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exuN6-0005pf-Bq for ged-emacs-devel@m.gmane.org; Mon, 19 Mar 2018 08:58:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exuMH-0005oV-2H for emacs-devel@gnu.org; Mon, 19 Mar 2018 08:57:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exuMC-00079f-86 for emacs-devel@gnu.org; Mon, 19 Mar 2018 08:57:49 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55265) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exuMC-00079M-3V; Mon, 19 Mar 2018 08:57:44 -0400 Original-Received: from [176.228.60.248] (port=2758 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1exuMB-0002oR-AK; Mon, 19 Mar 2018 08:57:43 -0400 In-reply-to: (message from Sebastian Sturm on Mon, 19 Mar 2018 10:53:52 +0100) 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-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:223813 Archived-At: > From: Sebastian Sturm > Date: Mon, 19 Mar 2018 10:53:52 +0100 > > On 03/19/2018 07:43 AM, Eli Zaretskii wrote: > >> From: Sebastian Sturm > >> Date: Mon, 19 Mar 2018 00:20:13 +0100 > >> > >> for the record, I just switched back to emacs master (no noverlay) and > >> the time reported by (benchmark-run 1000 (line-number-at-pos (point)) > >> increased by a factor of ~40, to 75-80s. At this level, editing is > >> unbearably slow. With the semantic highlighter disabled, the same > >> measurement yields ~2.5s (still painfully slow, but borderline usable), > >> so about the same time reported by the noverlay branch. > > > > You will have to explain why overlays and the semantic highlighter > > affect line-counting. How about presenting a profile produced by > > "M-x profiler-report"? > > please find below a profiler report taken this morning (on my PC at > work, which doesn't suffer from the performance issue as much as my 2014 > MacBook Pro, but even here the issue is clearly noticeable) That profile says that self-insert-command takes a large percentage of the time. So I think we should look into the reasons for such a strange place to spend hundreds of microseconds. According to the profile, line-number-at-pos takes about the same percentage of time as self-insert-command does. And that is even before you optimize the successive calls to line-counting code to take advantage of the previously computed value for some close line. > > And the timings you measure are 2.5 _milliseconds_ (the benchmark runs > > 1000 times), right? If so, I cannot understand why you say that's > > borderline usable, because IME such short times are imperceptible by > > humans. I guess some other factor is at work here, so I'd suggest to > > describe more details about your use case. > > well no, it's about 2.5ms per call to line-number-at-pos, which is > called at least 6 times per character insertion (with my Emacs config, > at least). Which already makes for 15ms per character insertion, > excluding anything else done by cc-mode or lsp-mode. Then, as I said, I don't understand why it takes so much on your system. I get times that are 10 times faster.