You are looking at historical revision 30892 of this page. It may differ significantly from its current revision.
micro-benchmark
Repository
https://bitbucket.org/certainty/micro-benchmark/overview
Authors
Introduction
This egg provides means to benchmark your code in a simple manner.
Examples
(use micro-benchmark) (benchmark-measure (sleep 2)) ;; run code 3 times and return results (parameterize ((current-benchmark-iterations 3)) (benchmark-run (sleep 1)))
API
[parameter] current-benchmark-iterationsThe amount of iterations that are used in benchmark-run. This defaults to 100.
[syntax] (benchmark-measure ?code ...)Runs the ?code once and returns the runtime in microseconds.
[syntax] (benchmark-run [iterations] ?code ...)Runs the ?code iterations times and returns an alist with the following keys:
- min - the minimum runtime of all iterations in microseconds
- max - the maximum runtime of all iterations in microseconds
- mean - the average runtime of all iterations in microseconds
- standard-deviation - the sample standard deviation for the given runtimes
If iterations is not given then curren-benchmark-iterations is used.
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/>.