From cb524787c155ca66cf56eb3741d065bc0bb63578 Mon Sep 17 00:00:00 2001 From: Ben Perry Date: Sun, 18 Aug 2024 13:54:07 -0500 Subject: [PATCH] add README --- tools/README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 tools/README.md diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 0000000..7df494d --- /dev/null +++ b/tools/README.md @@ -0,0 +1,61 @@ +# Benchmarking + +The `bench` command provides a set of tools used for benchmarking the performance of pixel under various scenarios. +It is intended to be a development tool for comparing the performance of new implementations in pixel against previous iterations. + +## Usage + +List available benchmarks +``` +go run main.go bench ls +``` + +Run a benchmark +``` +go run main.go bench run imdraw-static +``` + +Write benchmark stats to a file +``` +go run main.go bench run imdraw-static -o imdraw-static-stats.json +``` + +## Profiling +Run benchmark with cpu/mem profiling enabled +``` +go run main.go bench run -c cpu.prof -m mem.prof +``` + +View profile on cmdline +``` +go tool pprof cpu.prof +``` + +View profile in browser (requires [graphviz](https://graphviz.org/download/)) +``` +go tool pprof -http :9000 cpu.prof +``` + +## Results + +### Machine Info + +Information about the machines used to record benchmark stats + +| Machine | OS/Distro | CPU | Memory | GPU | +| ------------------ | ------------------- | ----------------------------- | ------------------ | -------------- | +| bhperry-wsl | Linux Ubuntu 20.04 | Intel i7-8086K @ 4.00GHz | 8GiB | RTX 2080 | +| bhperry-win10 | Windows 10 | Intel i7-8086K @ 4.00GHz | 16GiB | RTX 2080 | + +### Stats + +| Machine | Pixel | Benchmark | Duration | Frames | FPS Avg | FPS Min | FPS Max | FPS Stdev | +| ------------------ | ------ | ------------------- | ---------- | ------- | ------- | ------- | ------- | --------- | +| bhperry-wsl | 2.2.0 | sprite | 30s | 5470 | 182.32 | 166 | 185 | 3.71 | +| bhperry-wsl | 2.2.0 | sprite-batched | 30s | 6084 | 202.79 | 168 | 208 | 7.09 | +| bhperry-wsl | 2.2.0 | imdraw-static | 30s | 2381 | 79.36 | 73 | 81 | 1.5 | +| bhperry-wsl | 2.2.0 | imdraw-moving | 30.02s | 2210 | 79.36 | 73 | 81 | 1.5 | +| bhperry-win10 | 2.2.0 | sprite | 30s | 15584 | 519.45 | 438 | 529 | 16.01 | +| bhperry-win10 | 2.2.0 | sprite-batched | 30s | 71951 | 2398.37 | 2099 | 2443 | 59.15 | +| bhperry-win10 | 2.2.0 | imdraw-static | 30.02s | 1509 | 50.26 | 26 | 52 | 4.53 | +| bhperry-win10 | 2.2.0 | imdraw-moving | 30.01s | 1446 | 48.19 | 21 | 50 | 5.19 |