From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Sebastian Sturm Newsgroups: gmane.emacs.devel Subject: Re: State of the overlay tree branch? Date: Mon, 19 Mar 2018 00:03:11 +0100 Message-ID: <9646341d-700b-4240-216b-8c0e753fa79f@arkona-technologies.de> References: <834lldp18f.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1521414125 4060 195.159.176.226 (18 Mar 2018 23:02:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 18 Mar 2018 23:02:05 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 19 00:02:01 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 1exhJQ-0000nZ-IW for ged-emacs-devel@m.gmane.org; Mon, 19 Mar 2018 00:02:00 +0100 Original-Received: from localhost ([::1]:39410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exhLO-0003Qr-DY for ged-emacs-devel@m.gmane.org; Sun, 18 Mar 2018 19:04:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1exhKf-0003Qa-75 for emacs-devel@gnu.org; Sun, 18 Mar 2018 19:03:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1exhKc-0001ik-48 for emacs-devel@gnu.org; Sun, 18 Mar 2018 19:03:17 -0400 Original-Received: from smtp-out003.kontent.com ([81.88.40.217]:51866) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1exhKb-0001hy-Ts for emacs-devel@gnu.org; Sun, 18 Mar 2018 19:03:14 -0400 Original-Received: from [192.168.0.102] (unknown [82.195.74.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: arkona-technologies_de_22@smtp-out003.kontent.com) by smtp-out003.kontent.com (Postfix) with ESMTPSA id 3424A400034C for ; Mon, 19 Mar 2018 00:03:12 +0100 (CET) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 81.88.40.217 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:223795 Archived-At: concerning the performance improvement with noverlay, it seems I spoke=20 to soon. I've now had the issue reappear, both with the noverlay branch,=20 and with the semantic highlighter set to use font-lock. Sorry for the=20 misinformation. Again, however, line-number-at-pos shows up as a large CPU time consumer=20 in the profiler report, and benchmark-run still reports several ms per=20 invocation (though this time it's usually around 2 to 4 ms instead of=20 the 20 to 25 I measured earlier), so I'd still be very much interested=20 in a faster line-number-at-pos implementation. On 03/18/2018 10:04 PM, Sebastian Sturm wrote: > I also found it surprising that overlays would slow down line counting,= =20 > but since I don't know anything about the architecture of the Emacs=20 > display engine, or its overlay implementation, I figured that overlays=20 > must be to blame because >=20 > (i) the issue went away after switching to the feature/noverlay branch >=20 > (ii) configuring the semantic highlighter to use its font-lock backend=20 > also resolved the performance issue (though with the font-lock backend,= =20 > highlights are easily messed up by editing operations which makes the=20 > overlay variant far more appealing) >=20 > I also found that some other heavy users of overlays such as=20 > avy-goto-word-0-{above,below} feel faster with the feature/noverlay=20 > branch, so I'd welcome a merge of the overlay branch even if there was = a=20 > technically superior alternative to line-number-at-pos that didn't=20 > suffer from overlay-related performance issues. >=20 > That being said, your suggestion sounds intriguing. What would be=20 > required to expose find_newline to Lisp? Would I simply have to wrap it= =20 > in one of Emacs's DEFINE_ macros? Is there some documentatio= n=20 > on the Emacs C backend? >=20 > On 03/18/2018 09:39 PM, Eli Zaretskii wrote: > >> From: Sebastian Sturm > >> Date: Sun, 18 Mar 2018 21:14:53 +0100 > >> > >> [1] I'm using cquery for my C++ editing needs, which comes with an > >> overlay-based semantic highlighting mechanism. With my emacs > >> configuration, lsp-mode/lsp-ui emit 6 calls to line-number-at-pos p= er > >> character insertion, which consume ~20 to 25 ms each when performin= g > >> edits close to the bottom of a 66KB C++ file (measured using > >> (benchmark-run 1000 (line-number-at-pos (point))) on a release buil= d of > >> emacs-27/git commit #9942734...). Using the noverlay branch, this=20 > figure > >> drops to ~160us per call. > > > > If lsp-mode/lsp-ui needs a fast line counter, one can easily be > > provided by exposing find_newline to Lisp.=C2=A0 IME, it's lightning= -fast, > > and should run circles around count-lines (used by line-number-at-po= s). > > > > (I'm not sure I even understand how overlays come into play here, > > btw.) >=20