module Benchmark::IPS

Overview

Benchmark IPS calculates the number of iterations per second for a given block of code. The strategy is to use two stages: awarmup stage and a calculation stage.

Thewarmup phase defaults to 2 seconds. During this stagewe figure out how many cycles are needed to run the block for roughly 100ms, and record it.

The calculation defaults to 5 seconds. During this stagewe run the block in sets of the size calculated in thewarmup stage. The measurements for those sets are then used to calculate the mean and standard deviation, which are then reported. Additionallywe compare the means to that of the fastest.

Defined in:

benchmark/ips.cr