benchfmt

package
v0.269.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package benchfmt renders a bench.Result as the human-readable benchmark report shared by the CLI and the playground.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch

func Dispatch(f float64) string

Dispatch renders a dispatch count with at most one decimal.

func Pair

func Pair(before, after string, wb, wa int) string

Pair renders "before → after" with each half right-aligned to its width.

func PctLabel

func PctLabel(b, a float64) string

PctLabel is the signed rounded percent change, blank when the values are equal or the baseline is zero.

func Plural

func Plural(n int, noun string) string

Plural renders a count with its noun, adding an "s" unless the count is 1.

func Render

func Render(w io.Writer, r *bench.Result) error

Render prints the benchmark report: deny-check totals, then the deny checks whose cost changed (or all of them in profile mode). Allow checks stop early, so their read counts are noise and only appear in the footer.

func Summary

func Summary(r *bench.Result) []string

Summary returns the benchmark header, totals and unexercised warning as lines, without the table or any leading blank line.

func Totals

func Totals(r *bench.Result) []string

Totals returns the totals block lines exactly as Render prints them: deny reads and dispatches, plus the answers line unless r is a profile run.

func Unexercised

func Unexercised(r *bench.Result) []string

Unexercised returns the unexercised warning as lines, or nil when every rewritten relation was exercised.

Types

This section is empty.

Jump to

Keyboard shortcuts

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