Benchmark::IPS

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: a warmup stage and a calculation stage.

The warmup phase defaults to 2 seconds. During this stage we 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 stage we run the block in sets of the size calculated in the warmup stage. The measurements for those sets are then used to calculate the mean and standard deviation, which are then reported. Additionally we compare the means to that of the fastest.

Defined in:

benchmark/ips.cr

© 2012–2017 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.22.0/Benchmark/IPS.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部