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 00:29:51 +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> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004009880594e73f02" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="170805"; 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 01:30:50 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 1iK9nd-000iK9-Tp for ged-emacs-devel@m.gmane.org; Tue, 15 Oct 2019 01:30:50 +0200 Original-Received: from localhost ([::1]:58556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iK9nc-0003hd-Q9 for ged-emacs-devel@m.gmane.org; Mon, 14 Oct 2019 19:30:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47960) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iK9my-0003Bd-27 for emacs-devel@gnu.org; Mon, 14 Oct 2019 19:30:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iK9mw-0003cs-PH for emacs-devel@gnu.org; Mon, 14 Oct 2019 19:30:07 -0400 Original-Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]:37367) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iK9mu-0003ag-HB; Mon, 14 Oct 2019 19:30:04 -0400 Original-Received: by mail-io1-xd32.google.com with SMTP id b19so41741777iob.4; Mon, 14 Oct 2019 16:30:04 -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=WgB3d1wIbJwboehlAjJHDeP38g87gGz1Em5GRqHjCmo=; b=doScB5dBNyFWCjZZ5ClkDUoh7LuK29ynJKl9apbK2Lc0iVQaHokaY4QcwUz4DlaroH MMcG7mCydQVu9XBu33ot2xe9kKSUFbioWqJo7Xcd3vYhmBkq9oHXpS5296FpdR6dxyRY 7tAPLpq/n35yElxrhJHJEifYWxOqXwYjIV3gs7h3NQyvPr8k5EcCSIlnfoPrQeoIchFU gtXzfgc2IDbtE+9ZG6TeUOfVY11IO1qWBi4k4RwMKhHwODGa4x73chkgw85S4IISFcFq YW3/ctNbJoO64PnH4FtthGrgW0kBoMZlUYjy2t692i3YHxUH1N/KoK89fbYgjIlAp9Qd N66g== 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=WgB3d1wIbJwboehlAjJHDeP38g87gGz1Em5GRqHjCmo=; b=WvLGevnfBtyQU1w4V8rEggigVXaOEEIpdVwW7bTh/ho4i8w9BSbEHMNsAPD/PFW5Qg /lHqyicuUMtcXfdb5IgZestmrjQ5jnDFLtqQW/8XNh0S3YhVdP/WxCSPCfB7AZiQM9Ru YiF3cDAS8zzZbHzMalfkU8wCc2b7EjB95JX9Alj7nAjQpwoZ/DwHfkPZi/9pTbm8NH43 YIR7fraU4OJN8C308ynbS+yIsXZZJ9idkuxH79lIugnmJRMzdDWHg3+HKCEsBjv0ilJG LOaP+i7yHMgg13XHqPbSg3gc1kZFTjTN2wfJkUHIXM5oDD5GfwQTc0fr6iubSrhiZj8i x8Cg== X-Gm-Message-State: APjAAAUqJ9LliIvnIsC8OIC2L3gpILbqcMiwAWdseX++c+uQ3EQTyoyD 3sXQgu5swxNH/7wQH3DQg3ZOpdUGgw6rc21wwK3dkhFS3Y8= X-Google-Smtp-Source: APXvYqxocUpiUpKsbeTnIFunI2vqyH3+b5uPBIKHiupJoiaRcmBf6nqnYjGnlGK4uGhfGyxdpMlgin20vBal3FbX3NM= X-Received: by 2002:a6b:4f03:: with SMTP id d3mr28279510iob.199.1571095803069; Mon, 14 Oct 2019 16:30:03 -0700 (PDT) In-Reply-To: <83k198ly94.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d32 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:241030 Archived-At: --0000000000004009880594e73f02 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Oct 13, 2019 at 11:45 AM Eli Zaretskii wrote: > > ? Or should I add a `redisplay` or something else there? > For timing the effect of post-command-hook, you need to actually > invoke many commands. I suggest to lean on the DOWN arrow for a fixed > amount of time, say, 30 sec, and see how far into the file did you go, > and what was the average CPU load (e.g, as shown by display-time-mode > or by 'top'). OK, I found some time to run these "manual" tests: So I tried this with and without the hook. I removed it (forcibly) with (remove-hook 'post-command-hook 'jit-lock--antiblink-post-command t) and re-added it with (add-hook 'post-command-hook 'jit-lock--antiblink-post-command nil t) before beginning the test. I confirmed that without the hook the feature is crippled and fails, and with the hook it works fine. This was easier then launching separate emacsen with jit-lock-antiblink-grace customized differently. 60 second-long C-n in src/xdisp.c, without antiblink: line 706, avg load 4% with antiblink: line 717, avg load 4% 30 second-long C-n in lisp/minibuffer.el, with antiblink: line 366, avg load 4% without antiblink: line 361, avg load 4% Time to end of buffer with C-v in lisp/minibuffer.el: with antiblink: 10 seconds, avg load 6% without antiblink: 10 seconds, avg load 6% Time to end of buffer with C-v in src/xdisp.c: without antiblink: 90 seconds, avg load 8% with antiblink: 91 seconds, avg load 8% I ran this with Emacs -Q with git commit 079461b360a2467ff4ab2ec57516c6f9e45f50fe on a 2013 Macbook Air running Mojave. The CPU load averages are computed "in my mind" from looking at top(1) output. Times are taken from a wristwatch. Thus, not really precise measurements at all. So, because these tests are kind of boring to conduct, I'd like you or someone else to reproduce (or fail to reproduce) one or two results before going any further. Nevertheless, I'd risk saying that your worries about the performance impact on these particular "paging" operations may not materialize at all. Jo=C3=A3o --0000000000004009880594e73f02 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Oct 13, 2019 at 11:45 AM Eli Zaretskii <eliz@gnu.org> wrote:
> > ? Or shou= ld I add a `redisplay` or something else there?
> For timing the effe= ct of post-command-hook, you need to actually
> invoke many commands.= =C2=A0 I suggest to lean on the DOWN arrow for a fixed
> amount of ti= me, say, 30 sec, and see how far into the file did you go,
> and what= was the average CPU load (e.g, as shown by display-time-mode
> or by= 'top').

OK, I found some time to run these "manual&quo= t; tests:

So I tried this with and without the hook. I removed it (f= orcibly) with

=C2=A0(remove-hook 'post-command-hook
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'jit-lock--antiblink-po= st-command t)
and re-added it with

=C2=A0(add-hook 'post-comm= and-hook
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0'jit-lock--antibli= nk-post-command nil t)

before beginning the test.

I confirmed= that without the hook the feature is crippled and fails, and
with the h= ook it works fine.=C2=A0 This was easier then launching separate
emacsen= with jit-lock-antiblink-grace customized differently.

60 second-lon= g C-n in src/xdisp.c,
=C2=A0 without antiblink: line 706, avg load 4%=C2=A0 with antiblink: line 717, avg load 4%
30 second-long C-n in lisp= /minibuffer.el,
=C2=A0 with antiblink: line 366, avg load 4%
=C2=A0 w= ithout antiblink: line 361, avg load 4%

Time to end of buffer with C= -v in lisp/minibuffer.el:
=C2=A0 with antiblink: 10 seconds, avg load 6%=
=C2=A0 without antiblink: 10 seconds, avg load 6%

Time to end of= buffer with C-v in src/xdisp.c:
=C2=A0 without antiblink: 90 seconds, a= vg load 8%
=C2=A0 with antiblink: 91 seconds, avg load 8%

I ran t= his with Emacs -Q with git commit
079461b360a2467ff4ab2ec57516c6f9e45f50= fe on a 2013 Macbook Air running
Mojave.

The CPU load averages ar= e computed "in my mind" from looking at top(1)
output. Times a= re taken from a wristwatch.=C2=A0 Thus, not really precise
measurements = at all.=C2=A0 So, because these tests are kind of boring to
conduct, I&#= 39;d like you or someone else to reproduce (or fail to
reproduce) one or= two results before going any further.

Nevertheless, I'd risk sa= ying that your worries about the performance
impact on these particular = "paging" operations may not materialize at
all.

Jo=C3=A3o
--0000000000004009880594e73f02--