summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2022-01-27 10:39:53 +0100
committerAndrea Corallo <akrl@sdf.org>2022-01-27 11:55:21 +0100
commit60cfb90d0161af4fc3219bba00525e7a3473601a (patch)
tree61dfb7dff3d4ed02fcbe1786d02dc82a91caedff /lisp/emacs-lisp
parenta8862f313b92ac0fad35c7240ef4da8e52d55c1d (diff)
downloademacs-60cfb90d0161af4fc3219bba00525e7a3473601a.tar.gz
emacs-60cfb90d0161af4fc3219bba00525e7a3473601a.tar.bz2
emacs-60cfb90d0161af4fc3219bba00525e7a3473601a.zip
* Have `benchmark-run-compiled' use the native compiler when available
* lisp/emacs-lisp/benchmark.el (benchmark-run-compiled): Use native compiler when available.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/benchmark.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/benchmark.el b/lisp/emacs-lisp/benchmark.el
index c5f621c6c86..882b1d68c48 100644
--- a/lisp/emacs-lisp/benchmark.el
+++ b/lisp/emacs-lisp/benchmark.el
@@ -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)