all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andrea Corallo <acorallo@gnu.org>
To: 75358@debbugs.gnu.org
Cc: pipcet@protonmail.com, monnier@iro.umontreal.ca
Subject: bug#75358: [scratch/elisp-benchmarks] repeated runs don't apply selector
Date: Mon, 06 Jan 2025 05:17:04 -0500	[thread overview]
Message-ID: <yp1ikqs5jrz.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <87cyh2fsep.fsf@protonmail.com> (Pip Cet via's message of "Sat, 04 Jan 2025 16:37:03 +0000")

Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text
editors" <bug-gnu-emacs@gnu.org> writes:

> On scratch/elisp-benchmarks, the following emacs -Q invocation:
>
> ./src/emacs --batch -Q -l ./elisp-benchmarks/elisp-benchmarks.el --eval '(progn (elisp-benchmarks-run) (delete-other-windows) (elisp-benchmarks-run "bubble"))'
>
> is equivalent to
>
> ./src/emacs --batch -Q -l ./elisp-benchmarks/elisp-benchmarks.el --eval '(progn (elisp-benchmarks-run) (delete-other-windows) (elisp-benchmarks-run))'
>
> but
>
> ./src/emacs --batch -Q -l ./elisp-benchmarks/elisp-benchmarks.el --eval '(progn (elisp-benchmarks-run "bubble") (delete-other-windows) (elisp-benchmarks-run))'
>
> is not.
>
> (The (delete-other-windows) is necessary because of other issues).
>
> The expected behavior is for the SELECTOR to determine the tests to be
> executed, as described in the documentation; in reality, it merely
> determines which tests are compiled, then all symbols matching the
> regexp produced below are executed.
>
> In the first example, the second SELECTOR argument has no effect,
> because the tests to be run are determined as:
>
> 	           (mapatoms (lambda (s)
> 	                      (let ((name (symbol-name s)))
> 	                        (when (and (fboundp s)
> 	                                   (string-match
> 	                                    "\\`elb-\\(.*\\)-entry\\'" name))
> 	                          (push (match-string 1 name) names)))))
>
> without respecting the SELECTOR argument in any fashion: any elisp
> function that happens to match the symbol format is run.
>
> "Fixing" this by applying the selector as a regular expression to the
> "name" value seems simple enough, as a stop-gap.

Yep, as mentioned elisp-benachmarks was made (in order to give
meaningful results) to run from a known state, running two times will
not give meaningful results.  Anyway applying the selector to the runner
as well seems a satisfactory fix to me.

> But: IMHO, reserving
> chunks of the symbol namespace for special uses is unsatisfactory and
> should be avoided.  This is true in both interactive and
> non-interactive emacs runs.  Running benchmarks in a live Emacs
> session can be useful; running functions based on their symbol name
> alone is dangerous.
>
> Of course, the selector is currently applied to file names, not test
> names, so we'd have to decide what (elisp-benchmarks-run "font-lock"),
> for example, is supposed to do.

We can also decide to apply it only to test names to disambiguate if we
prefer.





  reply	other threads:[~2025-01-06 10:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-04 16:37 bug#75358: [scratch/elisp-benchmarks] repeated runs don't apply selector Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
2025-01-06 10:17 ` Andrea Corallo [this message]
2025-01-06 14:39   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2025-01-06 20:35     ` Andrea Corallo

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=yp1ikqs5jrz.fsf@fencepost.gnu.org \
    --to=acorallo@gnu.org \
    --cc=75358@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=pipcet@protonmail.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.