Skip to content

v3.bench

fn new #

fn new() Bench

new creates a new value for bench.

struct Bench #

struct Bench {
mut:
	steps                 []Step
	metrics               []Metric
	total_sw              time.StopWatch
	step_sw               time.StopWatch
	last_allocation_count u64
	last_allocated_bytes  u64
}

Bench represents bench data used by bench.

fn (Bench) step #

fn (mut b Bench) step(name string)

step records a serial pipeline step.

fn (Bench) step_parallel #

fn (mut b Bench) step_parallel(name string, parallel bool)

step_parallel records a pipeline step, appending "(parallel)" to its name when the step actually ran across threads.

fn (Bench) metric #

fn (mut b Bench) metric(name string, value i64, unit string)

metric records a structural compiler counter for the final benchmark report.

fn (Bench) print_report #

fn (b &Bench) print_report()

print_report updates print report state for Bench.

struct Metric #

struct Metric {
pub:
	name  string
	value i64
	unit  string
}

Metric represents one structural compiler counter reported with a build.

struct Step #

struct Step {
pub:
	name             string
	time_us          i64
	ram_kb           i64
	peak_ram_kb      i64
	allocation_count u64
	allocated_bytes  u64
}

Step represents step data used by bench.