all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Hi-Angel <hiangel999@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Lexical binding doesn't seem to be faster?
Date: Sat, 09 Mar 2019 10:06:28 -0500	[thread overview]
Message-ID: <jwvd0n0xffv.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAHGDjgCXC01U7ewG9D=bx8BDtErvzR2yRAjKrUgG+UJ-iHyQRA@mail.gmail.com> (Hi-Angel's message of "Fri, 8 Mar 2019 16:33:50 +0300")

> Ah, thanks! Previously I only found `benchmark` function, but running
>
>      (benchmark 10 (c-font-lock-fontify-region 0 (point-max)))
>
> results in error "void-function jit-lock-bounds".

With `benchmark` you need to quote the argument (it's a function, not
a macro).

[ BTW, (point-min) is more better than 0.  ]

> FTR: I re-benchmarked as `(benchmark-run-compiled 10
> (c-font-lock-fontify-region 0 (point-max)))`, and also with `emacs -Q`
> to make sure that none of addons can interfere (I'm using
> color-identifiers which may add an overhead to fontification).  For the
> same reason I disabled GC (locally I too have it only enabled to run
> at "idle time").

Good (except for disabling GC, which makes the measurement different
from "real life").

> It's interesting that the difference almost disappeared:
>
>     nil: (7.463936164 0 0.0) (7.520960622 0 0.0) (7.526411695999999 0
> 0.0) (7.537842362999999 0 0.0)
>     t:   (7.617106151000001 0 0.0) (7.635044875 0 0.0)
> (7.6383228789999995 0 0.0) (7.598431915 0 0.0)
>
> "nil" still seems to be faster, but it may as well be a statistical variation.

It looks minor but it seems stable enough to be more than just
statistical variation.

> Either way, I'm happy, as you suggested, to look at per-function
> overhead to see if there's any difference. Do you think it's still
> worth it?

Hard to tell.

> And how do I do it though?  Shall I do (profiler-start), and
> then evaluate the benchmark?

Do (profiler-start 'cpu) before running the benchmark and
(profiler-report) afterwards. And then C-u RET on the top line to expand
it (recursively).


        Stefan



  reply	other threads:[~2019-03-09 15:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-06 23:36 Lexical binding doesn't seem to be faster? Hi-Angel
2019-03-08  5:39 ` Stefan Monnier
2019-03-08  8:30   ` tomas
2019-03-08 13:53     ` Stefan Monnier
2019-03-09  8:21       ` tomas
2019-03-08 13:33   ` Hi-Angel
2019-03-09 15:06     ` Stefan Monnier [this message]
2019-03-10 15:16       ` Hi-Angel
2019-03-10 16:14         ` Hi-Angel
2019-03-10 18:07         ` Stefan Monnier
2019-03-10 18:47           ` Hi-Angel
2019-03-10 18:59             ` Stefan Monnier
2019-03-10 19:53               ` Hi-Angel
2019-03-10 20:48                 ` Stefan Monnier
2019-03-10 21:22                   ` Hi-Angel
2019-03-11 19:16                     ` Hi-Angel
2019-03-11 19:26                       ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvd0n0xffv.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    --cc=hiangel999@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.