all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pip Cet via "Emacs development discussions." <emacs-devel@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: acorallo@gnu.org, stefankangas@gmail.com, mattiase@acm.org,
	eggert@cs.ucla.edu, emacs-devel@gnu.org
Subject: Re: New "make benchmark" target
Date: Mon, 30 Dec 2024 17:25:44 +0000	[thread overview]
Message-ID: <87o70txew4.fsf@protonmail.com> (raw)
In-Reply-To: <86jzbhnmzg.fsf@gnu.org>

"Eli Zaretskii" <eliz@gnu.org> writes:

Top-posted TL;DR: let's call Andrea's code "make elisp-benchmarks" and
include it now?  That would preserve the Git history and importantly (to
me) reserve the name for now.

>> Date: Mon, 30 Dec 2024 15:49:30 +0000
>> From: Pip Cet <pipcet@protonmail.com>
>> Cc: acorallo@gnu.org, stefankangas@gmail.com, mattiase@acm.org, eggert@cs.ucla.edu, emacs-devel@gnu.org, joaotavora@gmail.com
>>
>> >> https://lists.gnu.org/archive/html/emacs-devel/2024-12/msg00595.html
>> >
>> > Thanks, but AFAICT this just says that you intended to use/extend ERT
>> > to run this benchmark suite, but doesn't explain why you think using
>> > ERT would be an advantage worthy of keeping.
>>
>> I think some advantages are stated in that email: the ERT tagging
>> mechanism is more general, works, and can be extended (I describe one
>> such extension).  All that isn't currently true for elisp-benchmarks.
>
> Unlike the rest of the test suite, where we need a way to be able to
> run individual tests, a benchmark suite is much more likely to run as
> a whole, because benchmarking a single kind of jobs in Emacs is much
> less useful than producing a benchmark of a representative sample of
> jobs.  So I'm not sure this particular aspect is such a serious

Not my experience.  Running the entire suite is much more likely not to
produce usable data due to such issues as CPU thermal management (for
example: the first few tests are run at full clock speed and heat up the
system so much that thermal throttling is activated; the next few tests
are run at a reduced rate while the fan is running; eventually we run
out of amperes that we're allowed to drain the battery by and reduce
clock speed even further; this results in reduced temperature, so the
fan speed is reduced, which means we will eventually decide to try a
higher clock speed again, which will work for a while only before
repeating the cycle.  The whole thing will appear regular enough we
won't notice the data is bad, but it will be, until we rerun the test on
the same system in a different room and get wildly different results).
A single-second test run in a loop produces the occasional mid-stream
result which is actually useful (and promptly lost to the averaging
mechanism of elisp-benchmarks).

Benchmarking is hard, and I wouldn't have provided this very verbose
example if I hadn't seen "paradoxical" results that can only be
explained by such mechanisms.  We need to move away from average run
times either way, and that requires code changes.

And I don't usually run ERT tests individually, while I'm trying to get
in the habit of running the (non-expensive) test suite before I push.

> problem, certainly if it makes the job of adding the suite much
> harder.

I don't think time-to-Emacs is very different for the two approaches.
The difference is the post-merge work.

>> The other big difference is resource management, which elisp-benchmarks
>> does via a global variable, reusing one test as data for another.  ERT
>> has a somewhat better mechanism.
>
> This is just an argument for cleaner, more elegant code, right?  If
> so, I think we can live with the issue.  Having a ready-t-run
> benchmark suite is so much more important that I'm prepared to make
> compromises.
>
>> > Why do you think it is wrong to do the (AFAIU) simple change that
>> > Andrea proposed?
>>
>> Because it's a de facto commitment to not doing it in ERT.
>
> Probably, but that in itself is not a catastrophe, surely?

Hmm.  I disagree, but I think the real catastrophe would be wasting the
make target name, not the inclusion of another directory.

My suggestion is a compromise: add "make elisp-benchmarks" now, using
Andrea's code, then consider more complicated ERT-based approaches
without being in any hurry to do so.  But, also, let's agree that the
ERT-based approaches are "allowed" to reuse the elisp-benchmarks code
without providing comparable results or a porting mechanism, and keep
the "make benchmark" name reserved for a while.

My prediction is that it will turn out "make elisp-benchmarks" doesn't
usually provide very useful results, and expansion of the test framework
to produce useful results is easier reusing the ERT framework.

>> It might be relevant that elisp-benchmarks hasn't seen very active
>> development lately.  I think switching to ERT might help there, if only
>> because of the mailing list traffic.
>
> My vote is to get the job done the fastest way possible.  Tests are

Well, the ERT patch is ready "right now" (meaning it needs rebasing).
The elisp-benchmarks code would require, at least, whitespace fixes ;-)

> not Emacs itself, they are means towards a certain end, and so can use
> less clean code and designs, at least IMO.

To be perfectly honest, I was worried about the commit history because
in the Good Old CVS Days, file renames were more of a problem than they
are with git.  With git, I would prefer one "this is elisp-benchmarks"
commit even if the subsequent history modifies and moves those files.
So no reason not to do that now?  Thanks for your patience.

I can prepare a git branch doing that.  As for the git history rewriting
magic code, I've heard from Joao and the other developer involved; he
doesn't have a copyright assignment, but also thinks this is small
enough to be paperwork-exempt, so we can (probably) include a script in
admin/ to migrate elpa packages to core.

My preference would be a top-level directory called "elisp-benchmarks",
but ultimately that's a minor question, so just let me know the
preferred destination.

Pip




  reply	other threads:[~2024-12-30 17:25 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11 22:37 Improving EQ Pip Cet via Emacs development discussions.
2024-12-12  6:36 ` Eli Zaretskii
2024-12-12  8:23   ` Andrea Corallo
2024-12-12  8:36   ` Pip Cet via Emacs development discussions.
2024-12-12  9:18     ` Eli Zaretskii
2024-12-12  9:35     ` Visuwesh
2024-12-12 10:40     ` Andrea Corallo
2024-12-12 17:46       ` Pip Cet via Emacs development discussions.
2024-12-12 19:09         ` Eli Zaretskii
2024-12-12 10:53     ` New "make benchmark" target Stefan Kangas
2024-12-12 10:59       ` Andrea Corallo
2024-12-12 16:53         ` Pip Cet via Emacs development discussions.
2024-12-13  0:49           ` Stefan Kangas
2024-12-13  7:37             ` Andrea Corallo
2024-12-14 12:00               ` Stefan Kangas
2024-12-14 14:06                 ` Stefan Monnier
2024-12-14 11:34             ` Pip Cet via Emacs development discussions.
2024-12-14 11:58               ` Stefan Kangas
2024-12-14 20:07                 ` Pip Cet via Emacs development discussions.
2024-12-14 20:20                   ` João Távora
2024-12-15  0:57                   ` Stefan Kangas
2024-12-22 16:04                     ` Pip Cet via Emacs development discussions.
2024-12-29 10:47                       ` Andrea Corallo
2024-12-30 11:45                         ` Pip Cet via Emacs development discussions.
2024-12-30 14:15                           ` Eli Zaretskii
2024-12-30 15:00                             ` Pip Cet via Emacs development discussions.
2024-12-30 15:21                               ` Eli Zaretskii
2024-12-30 15:49                                 ` Pip Cet via Emacs development discussions.
2024-12-30 15:53                                   ` João Távora
2024-12-30 16:40                                   ` Eli Zaretskii
2024-12-30 17:25                                     ` Pip Cet via Emacs development discussions. [this message]
2024-12-30 18:16                                       ` Eli Zaretskii
2024-12-31  4:00                                         ` Pip Cet via Emacs development discussions.
2024-12-31  5:26                                           ` Stefan Kangas
2024-12-31 13:05                                             ` Eli Zaretskii
2024-12-31 14:14                                               ` Pip Cet via Emacs development discussions.
2024-12-31 14:22                                                 ` Eli Zaretskii
2024-12-31 12:53                                           ` Eli Zaretskii
2024-12-31 14:34                                             ` Andrea Corallo
2024-12-30 18:26                                       ` Andrea Corallo
2024-12-30 18:58                                         ` Stefan Kangas
2024-12-30 21:34                                         ` Pip Cet via Emacs development discussions.
2024-12-31  9:55                                           ` Andrea Corallo
2024-12-31 12:43                                           ` Eli Zaretskii
2024-12-31 14:01                                             ` Pip Cet via Emacs development discussions.
2024-12-15  0:58                   ` Stefan Kangas
2024-12-12 10:42 ` Improving EQ Óscar Fuentes
2024-12-12 10:50   ` Andrea Corallo
2024-12-12 11:21     ` Óscar Fuentes
2024-12-13 12:24       ` Pip Cet via Emacs development discussions.
2024-12-12 17:05     ` Pip Cet via Emacs development discussions.
2024-12-12 18:10     ` John ff

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=87o70txew4.fsf@protonmail.com \
    --to=emacs-devel@gnu.org \
    --cc=acorallo@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=eliz@gnu.org \
    --cc=mattiase@acm.org \
    --cc=pipcet@protonmail.com \
    --cc=stefankangas@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.