all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#75358: [scratch/elisp-benchmarks] repeated runs don't apply selector
@ 2025-01-04 16:37 Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2025-01-06 10:17 ` Andrea Corallo
  0 siblings, 1 reply; 4+ messages in thread
From: Pip Cet via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2025-01-04 16:37 UTC (permalink / raw)
  To: 75358

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.






^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-06 20:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.