Skip to content

Commit

Permalink
add README
Browse files Browse the repository at this point in the history
  • Loading branch information
bhperry committed Aug 18, 2024
1 parent 4ecea88 commit cb52478
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -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 |

0 comments on commit cb52478

Please sign in to comment.