module Lapis::Benchmark

Defined in:

libgodot/benchmarks.cr

Class Method Summary

Class Method Detail

def self.after_case(&block : Case, Result, Context -> Nil) #

def self.after_group(&block : Group, GroupResult, Context -> Nil) #

def self.after_suite(&block : Summary, Context -> Nil) #

def self.all : Array(Case) #

def self.all_groups : Array(Group) #

def self.before_case(&block : Case, Context -> Nil) #

def self.before_group(&block : Group, Context -> Nil) #

def self.before_suite(&block : Context -> Nil) #

Register lifecycle hooks


def self.clear : Nil #

def self.find_group(name : String) : Group | Nil #

def self.group(name : String, category : Category = Category::Custom, description : String = "", &block : Group -> Nil) : Group #

Define a comparison group containing multiple benchmarks or language targets


def self.register(name : String, category : Category = Category::Custom, description : String = "", &block : Int32 -> Nil) : Case #

Register a single benchmark case in Crystal


def self.report_elapsed_ms(ms : Float64) : Nil #

Allows a benchmark to specify its own accurate elapsed time


def self.report_metric(key : String, value : Float64) : Nil #

Allows a benchmark to report secondary custom metrics (compile time, memory, throughput)


def self.report_output(val : String) : Nil #

Allows a benchmark to specify its output result / checksum for parity verification


def self.run_all(iterations : Int32 = 3, ctx : Context | Nil = nil) : Array(Result) #

Run all registered benchmarks


def self.run_all_groups(iterations : Int32 = 3, ctx : Context | Nil = nil) : Array(GroupResult) #

Run all registered groups


def self.run_case(c : Case, iterations : Int32 = 3) : Result #

Measure a single benchmark case across N iterations


def self.run_group(group : Group, iterations : Int32 = 3, ctx : Context | Nil = nil) : GroupResult #

Execute a group and return comparative results against the designated baseline


def self.run_target(target : TargetSpec, iterations : Int32 = 3, ctx : Context | Nil = nil) : TargetResult #

Measure an in-engine target within a group across N iterations


def self.trigger_after_case(c : Case, r : Result, ctx : Context) : Nil #

def self.trigger_after_group(g : Group, gr : GroupResult, ctx : Context) : Nil #

def self.trigger_after_suite(sum : Summary, ctx : Context) : Nil #

def self.trigger_before_case(c : Case, ctx : Context) : Nil #

def self.trigger_before_group(g : Group, ctx : Context) : Nil #

def self.trigger_before_suite(ctx : Context) : Nil #

Trigger lifecycle hooks