Documentation
¶
Overview ¶
Package luabench measures runtime and memory performance of transpiled Lua code. Benchmarks are TypeScript files in benchmarks/ that export a default function. The harness transpiles them, wraps with os.clock/collectgarbage measurement, and runs via LuaJIT (or another runtime).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LuaTargetForRuntime ¶
func LuaTargetForRuntime(runtime string) transpiler.LuaTarget
LuaTargetForRuntime maps a runtime binary name to a transpiler LuaTarget.
func PrintLua ¶
func PrintLua(results []Result)
PrintLua prints the transpiled Lua for each benchmark, grouped by name with tstl and optimized side by side.
func PrintTable ¶
func PrintTable(results []Result)
PrintTable prints benchmark results as an aligned table with deltas. Results are expected in pairs: [tstl, optimized] for each benchmark.
Types ¶
type Bench ¶
type Bench struct {
Name string
Iterations int // how many times the function is called for timing
}
Bench defines a benchmark to run.
Click to show internal directories.
Click to hide internal directories.