1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 10:31:37 -08:00

* Have `benchmark-run-compiled' use the native compiler when available

* lisp/emacs-lisp/benchmark.el (benchmark-run-compiled): Use native
compiler when available.
This commit is contained in:
Andrea Corallo 2022-01-27 10:39:53 +01:00
parent a8862f313b
commit 60cfb90d01

View file

@ -121,7 +121,11 @@ result. The overhead of the `lambda's is accounted for."
(unless (or (natnump repetitions) (and repetitions (symbolp repetitions)))
(setq forms (cons repetitions forms)
repetitions 1))
`(benchmark-call (byte-compile '(lambda () ,@forms)) ,repetitions))
`(benchmark-call (,(if (native-comp-available-p)
'native-compile
'byte-compile)
'(lambda () ,@forms))
,repetitions))
;;;###autoload
(defun benchmark (repetitions form)