unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [elpa] externals/elisp-benchmarks 8a8e9fa6a8: Make it usable on Emacs-27
       [not found] ` <20220208154631.0867BC0DA37@vcs2.savannah.gnu.org>
@ 2022-02-10  8:42   ` Andrea Corallo
  2022-02-10 13:55     ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Andrea Corallo @ 2022-02-10  8:42 UTC (permalink / raw)
  To: emacs-devel; +Cc: Stefan Monnier

Stefan Monnier via <emacs-elpa-diffs@gnu.org> writes:

> branch: externals/elisp-benchmarks
> commit 8a8e9fa6a8c5a24841289a781a75fbb354cf71cb
> Author: Stefan Monnier <monnier@iro.umontreal.ca>
> Commit: Stefan Monnier <monnier@iro.umontreal.ca>
>
>     Make it usable on Emacs-27
>     
>     Also scale some of the benchmarks so they don't take less than 1s on my
>     test machine.
>     
>     * elisp-benchmarks.el (elb-std-deviation): Handle empty list.
>     (elisp-benchmarks-run): Catch errors so the benchmark suite can be used
>     on Emacs-27 even if not all of the benchmarks can be used.
>     
>     * benchmarks/pack-unpack.el: Place the old code first so it still gets
>     defined even if the new code signals an error.
>     * benchmarks/elb-bytecomp.el (elb-bytecomp-entry):
>     * benchmarks/elb-eieio.el (elb-eieio-entry):
>     * benchmarks/elb-smie.el (elb-smie-entry): Increase run time a bit.
>     (elb-smie--boi, elb-smie-mode): Silence some compiler warnings.
> ---
>  benchmarks/elb-bytecomp.el |  2 +-
>  benchmarks/elb-eieio.el    |  2 +-
>  benchmarks/elb-smie.el     |  4 +--
>  benchmarks/fibn.el         |  7 +++--
>  benchmarks/pack-unpack.el  | 70 ++++++++++++++++++++++++----------------------
>  elisp-benchmarks.el        | 33 ++++++++++++++--------
>  6 files changed, 65 insertions(+), 53 deletions(-)
>

[...]

> diff --git a/elisp-benchmarks.el b/elisp-benchmarks.el
> index 4fe10b87a4..f6943b9784 100644
> --- a/elisp-benchmarks.el
> +++ b/elisp-benchmarks.el
> @@ -77,7 +77,7 @@
>    (let* ((n (length list))
>  	 (mean (/ (cl-loop for x in list
>  			   sum x)
> -		  n)))
> +		  (max n 1))))
>      (sqrt (/ (cl-loop for x in list
>  		   sum (expt (- x mean) 2))
>  	  (1- n)))))
> @@ -110,18 +110,22 @@ RECOMPILE all the benchmark folder when non nil."
>  	      (funcall compile-function f))
>  	    test-sources))
>      ;; Load
> -    (mapc #'load (mapcar (if (and (featurep 'native-compile)
> -				  (fboundp 'comp-el-to-eln-filename))
> -			     ;; FIXME: Isn't the elc->eln
> -                             ;; remapping fully automatic?
> -			     #'comp-el-to-eln-filename
> -			   #'file-name-sans-extension)
> -			 test-sources))
> +    (mapc (lambda (file)
> +	    (with-demoted-errors "Error loading: %S"
> +	      (load file)))
> +	  (mapcar (if (and (featurep 'native-compile)
> +			   (fboundp 'comp-el-to-eln-filename))
> +		      ;; FIXME: Isn't the elc->eln
> +                      ;; remapping fully automatic?
> +		      #'comp-el-to-eln-filename
> +		    #'file-name-sans-extension)
> +		  test-sources))
>      (let ((tests (let ((names '()))
>  	           (mapatoms (lambda (s)
>  	                      (let ((name (symbol-name s)))
> -	                        (when (string-match
> -	                               "\\`elb-\\(.*\\)-entry\\'" name)
> +	                        (when (and (fboundp s)
> +	                                   (string-match
> +	                                    "\\`elb-\\(.*\\)-entry\\'" name))
>  	                          (push (match-string 1 name) names)))))

Ah okay I see now.  Your previous changeset is fixed here changing the
semantic of `elisp-benchmarks-run'.

I think this change is an improvement but again *please* use commit
messages that makes sense and break&group your commits in a meaningfull
way.

This change (as others) has really nothing to do with "Make it usable on
Emacs-27".

Best Regards

  Andrea



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

* Re: [elpa] externals/elisp-benchmarks 8a8e9fa6a8: Make it usable on Emacs-27
  2022-02-10  8:42   ` [elpa] externals/elisp-benchmarks 8a8e9fa6a8: Make it usable on Emacs-27 Andrea Corallo
@ 2022-02-10 13:55     ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2022-02-10 13:55 UTC (permalink / raw)
  To: Andrea Corallo; +Cc: emacs-devel

>>      (let ((tests (let ((names '()))
>>  	           (mapatoms (lambda (s)
>>  	                      (let ((name (symbol-name s)))
>> -	                        (when (string-match
>> -	                               "\\`elb-\\(.*\\)-entry\\'" name)
>> +	                        (when (and (fboundp s)
>> +	                                   (string-match
>> +	                                    "\\`elb-\\(.*\\)-entry\\'" name))
>>  	                          (push (match-string 1 name) names)))))
>
> Ah okay I see now.  Your previous changeset is fixed here changing the
> semantic of `elisp-benchmarks-run'.

Not that the only change here is the use of `fboundp` to make sure we
don't try to run `elb-foo-entry` just because there's a symbol by that
name in the obarray.

> This change (as others) has really nothing to do with "Make it usable on
> Emacs-27".

It does: in Emacs-27, the function `elb-pack-unpack-entry` ends up not
being defined, but it somehow does end up interned in `obarray`.


        Stefan




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

end of thread, other threads:[~2022-02-10 13:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <164433519015.9248.5471973426006203013@vcs2.savannah.gnu.org>
     [not found] ` <20220208154631.0867BC0DA37@vcs2.savannah.gnu.org>
2022-02-10  8:42   ` [elpa] externals/elisp-benchmarks 8a8e9fa6a8: Make it usable on Emacs-27 Andrea Corallo
2022-02-10 13:55     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).