emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 60cfb90d01 1/2: * Have `benchmark-run-compiled' use the native co


From: Andrea Corallo
Subject: master 60cfb90d01 1/2: * Have `benchmark-run-compiled' use the native compiler when available
Date: Thu, 27 Jan 2022 05:56:18 -0500 (EST)

branch: master
commit 60cfb90d0161af4fc3219bba00525e7a3473601a
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    * Have `benchmark-run-compiled' use the native compiler when available
    
    * lisp/emacs-lisp/benchmark.el (benchmark-run-compiled): Use native
    compiler when available.
---
 lisp/emacs-lisp/benchmark.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/benchmark.el b/lisp/emacs-lisp/benchmark.el
index c5f621c6c8..882b1d68c4 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]