You are looking at historical revision 30574 of this page. It may differ significantly from its current revision.

micro-benchmark

Requirements

random-bsd, numbers

Repository

https://bitbucket.org/certainty/micro-benchmark/overview

Authors

David Krentzlin

Introduction

This egg provides means to benchmark your code in a simple manner.

Examples

(use micro-benchmark)

(benchmark-measure (sleep 2)) ;returns the runtime in microseconds

;; run code 3 times and return results
(parameterize ((current-benchmark-iterations 3))
  (benchmark-run (sleep 1)))

API

[parameter] current-benchmark-iterations

The amount of iterations that are used in benchmark-run.

[syntax] (benchmark-measure ?code ...)

Runs the ?code once and returns the elapsed runtime in microseconds.

[syntax] (benchmark-run [iterations] ?code ...)

Runs the ?code iterations times and returns an alist with the following keys:

If iterations is not given then curren-benchmark-iterations is used.

See also

To work with the data and derive information you might find statistics useful

License

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.
A full copy of the GPL license can be found at
<http://www.gnu.org/licenses/>.