You are looking at historical revision 30584 of this page. It may differ significantly from its current revision.
micro-benchmark
Requirements
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.
[syntax] (benchmark-measure ?code ...)Runs the ?code once and returns a pair.
- car - the runtime in microseconds
- cdr - the result of ?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
- avg - the average runtime of all iterations in microseconds
- runtimes - the list of all runtimes in microseconds
- values - the list of results
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/>.