From: Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 75358@debbugs.gnu.org
Subject: bug#75358: [scratch/elisp-benchmarks] repeated runs don't apply selector
Date: Sat, 04 Jan 2025 16:37:03 +0000 [thread overview]
Message-ID: <87cyh2fsep.fsf@protonmail.com> (raw)
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. 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.
IMHO, the proper fix is to use a working test registration mechanism,
ideally ERT.
next reply other threads:[~2025-01-04 16:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-04 16:37 Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2025-01-06 10:17 ` bug#75358: [scratch/elisp-benchmarks] repeated runs don't apply selector Andrea Corallo
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=87cyh2fsep.fsf@protonmail.com \
--to=bug-gnu-emacs@gnu.org \
--cc=75358@debbugs.gnu.org \
--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.