module Benchy

Defined in:

benchy.cr
instrument.cr
manifest.cr

Constant Summary

BIN_TIME = "/usr/bin/time -v"
CPU_TIME_PROC = ->(output : String, project : Project, configuration : Project::Configuration) do md_user = output.match(/User time \(seconds\):\s+(\d+.\d+)/m) md_sys = output.match(/System time \(seconds\):\s+(\d+.\d+)/m) if md_user && md_sys else raise("Missing time measure") end md_user[1].to_f64 + md_sys[1].to_f64 end
MAX_RSS_PROC = ->(output : String, project : Project, configuration : Project::Configuration) do md = output.match(/Maximum resident set size \(kbytes\):\s+(\d+)/m) if md else raise("Missing max_rss measure") end (md[1].to_i64 * 1024).to_f64 end
TIME_PROC = ->(output : String, project : Project, configuration : Project::Configuration) do md = output.match(/Elapsed \(wall clock\) time \(h:mm:ss or m:ss\):\s+((?<h>\d+):)?(?<m>\d+):(?<s>\d\d(.\d*)?)/m) if md else raise("Missing time measure") end (((md["h"]? || 0).to_f64 * 3600.0) + (md["m"].to_f64 * 60.0)) + md["s"].to_f64 end
VERSION = "0.1.0"