Help us shape the future of Go! Take the 2026 Go Developer Survey

selfbench

package
v0.51.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package selfbench measures file-discovered Flow workloads in process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cfg runner.Config, scenarios []Scenario, opts Options) int

Run returns 0 on success, 1 on compilation/execution/output failure, and 2 on invalid options. Config must belong to the caller's live runner Host.

Types

type Options

type Options struct {
	Out        io.Writer
	Iterations int
	Warmup     int
	JSON       bool
	List       bool
}

Options controls measurement; zero warmup is meaningful.

type Report

type Report struct {
	Version    int      `json:"version"`
	GoVersion  string   `json:"go_version"`
	OS         string   `json:"os"`
	Arch       string   `json:"arch"`
	CPUs       int      `json:"cpus"`
	GOMAXPROCS int      `json:"gomaxprocs"`
	Results    []Result `json:"results"`
}

type Result

type Result struct {
	Name       string                  `json:"name"`
	CompileMs  float64                 `json:"compile_ms"`
	FirstRunMs float64                 `json:"first_run_ms"`
	Warmup     int                     `json:"warmup"`
	Warm       nodes_bench.BenchRunRes `json:"warm"`
	Error      string                  `json:"error,omitempty"`
}

Result separates one compilation and first execution from warm samples.

type Scenario

type Scenario struct {
	Name   string `json:"name"`
	Source string `json:"-"`
	File   string `json:"-"`
}

Scenario is one source file; Name is its portable, suite-relative filter key.

func Discover

func Discover(path string, filters []string) ([]Scenario, error)

Discover recursively reads .nflow files in lexical order. An empty path uses the embedded suite. Explicit paths select a new filesystem root; symlinks within it are rejected, rather than following files outside that suite.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL