Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for [[/eggref/5/micro-benchmark|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 [[https://wiki.call-cc.org/chicken-projects/egg-index-5.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. == micro-benchmark [[toc:]] === Repository [[https://bitbucket.org/certainty/micro-benchmark/overview]] === Authors [[/users/david-krentzlin|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 <enscript highlight=scheme> (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)) </enscript> === API <parameter>current-benchmark-iterations</parameter> The amount of iterations that are used in '''benchmark-run'''. This defaults to 100. <syntax>(benchmark-measure ?code)</syntax> Runs the '''?code''' once and returns the runtime in microseconds. <syntax>(benchmark-run [iterations] ?code)</syntax> 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. <syntax>(benchmark-ips [seconds] ?code)</syntax> Determines how many times one can run the given '''?code''' per second and returns an alist with the following keys: * mean - the mean amount iterations we can make per second * standard-deviation - the sample standard deviation for the given iterations 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/>.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you multiply 1 by 0?