From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#75358: [scratch/elisp-benchmarks] repeated runs don't apply selector Date: Mon, 06 Jan 2025 05:17:04 -0500 Message-ID: References: <87cyh2fsep.fsf@protonmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10626"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: pipcet@protonmail.com, monnier@iro.umontreal.ca To: 75358@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 06 11:18:37 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tUkBw-0002Z1-BN for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Jan 2025 11:18:36 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUkBS-0006VS-3y; Mon, 06 Jan 2025 05:18:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUkBQ-0006Uy-EG for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 05:18:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tUkBQ-0007af-5x for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 05:18:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=Qa6RFQf/IrkmlFvxY9S3OMVy5DTu7YgJ7FsMfgCc0po=; b=avQu8Rvo1n25yPtjMxtQywSKDvO8Bg3oeAtj75tHwqezl1IVUWRvh8KsEp8gaHYDYc8fkJdeNbomF5eP52cedDvsWVZ4JU06lrCQWnyS6MSE2tHXjfgVx/fn6Lxa8L3kkQyA1IOGACdt8ZMiJQ9gSyRgv+Gm9F4fGyjl/L8B9Mq+5kz3Qi+ejCA8n7NADiH1zIrYFnlGBboEzT2eYPOZaZeim9T744Lnrs0fWYVJTNx1dnyhq1tDFI55Wzy3jsB9s06pLAQgLc6qFveYNVtFfpX8T01AwntBcbXGvNp40S+uQxguoK0Jz8uWygpQrzubWEjH2h+4KEr5E+OLPDlB/g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUkBP-0002gM-4a for bug-gnu-emacs@gnu.org; Mon, 06 Jan 2025 05:18:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jan 2025 10:18:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75358 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: Pip Cet , 75358@debbugs.gnu.org, Stefan Monnier Original-Received: via spool by 75358-submit@debbugs.gnu.org id=B75358.173615863910238 (code B ref 75358); Mon, 06 Jan 2025 10:18:03 +0000 Original-Received: (at 75358) by debbugs.gnu.org; 6 Jan 2025 10:17:19 +0000 Original-Received: from localhost ([127.0.0.1]:36767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUkAg-0002ez-L3 for submit@debbugs.gnu.org; Mon, 06 Jan 2025 05:17:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37302) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUkAZ-0002eS-7D for 75358@debbugs.gnu.org; Mon, 06 Jan 2025 05:17:13 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUkAT-0007M3-JK; Mon, 06 Jan 2025 05:17:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Qa6RFQf/IrkmlFvxY9S3OMVy5DTu7YgJ7FsMfgCc0po=; b=WLBV33PiUHHNeWTcbfe4 y+DJvyD2s9F+8v/pyPSK1ANi+wKL/e5fFEbIocJPmgbjwfPVZK3OVkUQOhgBvFIr5isjlae5AwBcb WdMzUMk6ac2rbe6GFu3dHIvGsCJCJQDpsC42C4W+SliPZaYNAtkzSFfj9JfrKHEfAhBJI/0uVeSRv jv1JfNASVa5XVrud58TizqXxJQwBxmRFFpejPq93GrJgjp1VcrxsYMs/OhRm2B4qm/uTnWYvSTiuY bfkhhkprar1x9Q6gck72654KyFz2c6KM8M3YOhBEXe67Ti2CIYePyvoS1xwmwcW6pbi+K0BTMkhwv wWOM0ku9akPucA==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1tUkAS-0002QZ-3O; Mon, 06 Jan 2025 05:17:04 -0500 In-Reply-To: <87cyh2fsep.fsf@protonmail.com> (Pip Cet via's message of "Sat, 04 Jan 2025 16:37:03 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298642 Archived-At: Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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.