Function: benchmark-run-compiled

benchmark-run-compiled is an autoloaded macro defined in benchmark.el.gz.

Signature

(benchmark-run-compiled &optional REPETITIONS &rest FORMS)

Documentation

Time execution of compiled version of FORMS.

This is like benchmark-run, but what is timed is a funcall of the byte code obtained by wrapping FORMS in a lambda and compiling the result. The overhead of the lambdas is accounted for.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/benchmark.el.gz
;;;###autoload
(defmacro benchmark-run-compiled (&optional repetitions &rest forms)
  "Time execution of compiled version of FORMS.
This is like `benchmark-run', but what is timed is a funcall of the
byte code obtained by wrapping FORMS in a `lambda' and compiling the
result.  The overhead of the `lambda's is accounted for."
  (declare (indent 1) (debug t))
  (unless (or (natnump repetitions) (and repetitions (symbolp repetitions)))
    (setq forms (cons repetitions forms)
	  repetitions 1))
  `(benchmark-call (,(if (native-comp-available-p)
                         'native-compile
                       'byte-compile)
                    '(lambda () ,@forms))
                   ,repetitions))