Outdated egg!

This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

micro-benchmark

  1. Outdated egg!
  2. micro-benchmark
    1. Repository
    2. Authors
    3. Introduction
    4. Examples
    5. API
    6. License

Repository

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

Authors

David Krentzlin

Introduction

This egg provides means to benchmark your code in a simple manner. It features traditional benchmarking with microsecond resolution as well as a different approach that has been inspired by: https://github.com/evanphx/benchmark-ips

Examples

(use micro-benchmark)

;; simply measure the runtime of the given fragment
(benchmark-measure (sleep 2)) 

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

;; find out how many iterations we can make per second
(benchmark-ips (sleep 2))

API

[parameter] current-benchmark-iterations

The 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:

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

[syntax] (benchmark-ips [seconds] ?code)

Determines how many times one can run the given ?code per second and returns an alist with the following keys:

If seconds is not given then it defaults to 5.

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/>.