From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: jit-lock-antiblink-grace Date: Tue, 15 Oct 2019 19:28:25 +0100 Message-ID: References: <834l0enw8c.fsf@gnu.org> <83y2xqm6m4.fsf@gnu.org> <83o8ymlzkk.fsf@gnu.org> <835zktm9o0.fsf@gnu.org> <83o8ylknjw.fsf@gnu.org> <83k198ly94.fsf@gnu.org> <83sgnuh5cq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000000fafa20594f727c2" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="231338"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Stefan Monnier , emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 15 20:29:43 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iKRZn-000y23-73 for ged-emacs-devel@m.gmane.org; Tue, 15 Oct 2019 20:29:43 +0200 Original-Received: from localhost ([::1]:56186 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKRZl-0006RI-Hs for ged-emacs-devel@m.gmane.org; Tue, 15 Oct 2019 14:29:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32854) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKRYn-0006Qe-OW for emacs-devel@gnu.org; Tue, 15 Oct 2019 14:28:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iKRYm-0005R0-G1 for emacs-devel@gnu.org; Tue, 15 Oct 2019 14:28:41 -0400 Original-Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]:41448) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iKRYk-0005OQ-4N; Tue, 15 Oct 2019 14:28:38 -0400 Original-Received: by mail-io1-xd2e.google.com with SMTP id n26so48226591ioj.8; Tue, 15 Oct 2019 11:28:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O/YyuieyyDXj7CGMtES6au2IqNPgdJyiNfIrgq32ZOY=; b=rRMn/zdALeGJ3bUF9YMJGmqCuTS4keimJjiQs6lyIOZBXjV5brZ5UFTSiGW7rrTn0k w4MHc3f0q5bEufUzsh3T7uc5C/zvIxRv4pg5Dk6Hm1iGjwXJT04VgReBITWfNc6YPg6c Hh7zArZceu6nPU+SEl/EnogWd3KVzeDeV11uAXzA/qZZUP6b7LJsV+vaznROA8DnprUH GQLrUaPj8RbmlKT8ZiJd7a3gvIhUyTTKcsgrflMEaxFVKDI3eJTt4sMNeYaNhbT2s2Il g6UQaaHUfWp2Dkbudi/5dWpwNvYa2k5RAzmXBozXp60GZOCxBFHoqICiY+tMUqp6BiR+ FwXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O/YyuieyyDXj7CGMtES6au2IqNPgdJyiNfIrgq32ZOY=; b=ED+U66SBrvySV0xD2eOrwpslPzuR3Q6OVqx8XTHMzku2imTKUC3Ee5tS29iEX55vUs PR7kIZ6XACD0hMPxEGqjfpTv5iHlEfr7rQFinfvoGrgm+KC31D+nxqXAuRtYDFEPoDTQ WePDSA9OuqlfWhzovt1ZNL7VvJOXCKDz4FTnNCyqr1B3sF+2qCzSq3IwIdG143Blt90Z AeAde5JH8i5Y3sOwclzLMEzU89vpyFdd2CXcY0p1fjgCq1y3agwTwUTDRwE5WBhL8OLm 4nbbJvLC3CEEmeDxzY9Wkt4Yt/tCUp7UQHjrnA6L0LQz5h4SkfIsxptU3mvSm+bisK7E k22g== X-Gm-Message-State: APjAAAU6NlaDYeSSreQHMQ4yYtyZjRf6ewZdDKFOQkDc/7hYfL3iUdOy FM8cNl7LX2TKAUMLEBnqYHe2i17s70Fn9uv+AAVmQbzJ X-Google-Smtp-Source: APXvYqzaDPfaBUpvLgLcl9MdkThGO1JF8JFMXXm8oJb9HElgrMvV73XVTsh7SZTIRuHWhbbT0n8e20eTE9686YMMIUs= X-Received: by 2002:a5e:db47:: with SMTP id r7mr7573244iop.9.1571164116723; Tue, 15 Oct 2019 11:28:36 -0700 (PDT) In-Reply-To: <83sgnuh5cq.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d2e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:241061 Archived-At: --0000000000000fafa20594f727c2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Oct 15, 2019 at 7:48 AM Eli Zaretskii wrote: > > This is encouraging, but please try C-n near the end of xdisp.c, so > that it includes syms_of_xdisp. The first 350 lines of xdisp.c is one > large comment, and there's a very small number of strings after that. OK. So same setup as before but running on Windows 10 on a i7 processor: 30 seconds from syms_of_xdisp (void) in src/xdisp.c: with antiblink: 34969, around 7% load measured by Process Explorer without: 34977, also around 7% load So I'd venture to say this didn't change much. I think the reason the C-n and C-v tests escape a big performance hit is that the potentially expensive operation, 'syntax-ppss', doesn't get called when you you have switched lines. So the presence or absence of strings is irrelevant. The most expensive operation will probably be `line-beginning-position` which is in C and apparently fast enough to not have any kind of relative impact. But now that I notice, the beginning of jit-lock--antiblink-post-command could be improved slightly to shortcut earlier and avoid one extra `line-beginning-position' call in these cases (though probably these rough benchmarks wouldn't show it.) So to summarize, for the "paging" scenario, the overhead of the post-command-based antiblink can be as low a 'copy-marker', an argless 'line-beginning-position' and few tests. Assuming you're OK with the performace aspects of the thing, I'll do the fixes you suggested earlier and re-submit (or push?) Jo=C3=A3o --0000000000000fafa20594f727c2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Oct 15, 2019 at 7:48 AM Eli Zaretskii <eliz@gnu.org> wrote:

>
> Th= is is encouraging, but please try C-n near the end of xdisp.c, so
> t= hat it includes syms_of_xdisp.=C2=A0 The first 350 lines of xdisp.c is one<= br>> large comment, and there's a very small number of strings after= that.

OK. So same setup as before but running on Windows 10 on a i7=
processor:

30 seconds from syms_of_xdisp (void) in src/xdisp.c:<= br>=C2=A0 with antiblink: 34969, around 7% load measured by Process Explore= r
=C2=A0 without: 34977, also around 7% load
=C2=A0
So I'd ve= nture to say this didn't change much.

I think the reason the C-n= and C-v tests escape a big performance hit is
that the potentially expe= nsive operation, 'syntax-ppss', doesn't get
called when you = you have switched lines.=C2=A0 So the presence or absence of
strings is = irrelevant.=C2=A0 The most expensive operation will probably be
`line-be= ginning-position` which is in C and apparently fast enough to
not have a= ny kind of relative impact.

But now that I notice, the beginning of = jit-lock--antiblink-post-command
could be improved slightly to shortcut = earlier and avoid one extra
`line-beginning-position' call in these = cases (though probably these
rough benchmarks wouldn't show it.)
=
So to summarize, for the "paging" scenario, the overhead of t= he
post-command-based antiblink can be as low a 'copy-marker', a= n argless
'line-beginning-position' and few tests.

Assumi= ng you're OK with the performace aspects of the thing, I'll do the<= br>
fixes you suggested earlier and re-submit (or push?)

=
Jo=C3=A3o
--0000000000000fafa20594f727c2--