docs(readme): add benchmark table pinned to v0.1.0
- commit
- 150eab2bf50164476a974b187a695f92a83ed61b
- author
- brice · · 2026-10-10 06:10 UTC
- parent
- 3b1b6ef
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
1 file · +23 -1
M README.md +23 -1
| @@ -21,7 +21,8 @@ output.DP-1.scale = 1.5 | |||
| 21 | 21 | - **Safe for real configs**: atomic saves, symlinked dotfiles, editors that | |
| 22 | 22 | save by rename, missing directories, broken files that keep the last good | |
| 23 | 23 | config, and warnings that never print values (they may be secrets). | |
| 24 | - | - **Fast**: about 800 MB/s to parse, a few allocations per reported change. | |
| 24 | + | - **Fast**: about 750 MB/s to parse, 2 allocations per reported change | |
| 25 | + | (see [Performance](#performance)). | |
| 25 | 26 | ||
| 26 | 27 | ```sh | |
| 27 | 28 | go get github.com/bnema/kvconf | |
| @@ -107,6 +108,27 @@ skips saves that change no value. | |||
| 107 | 108 | - `WriteFile`: atomic replace, written through symlinks. | |
| 108 | 109 | - `ReadFile`: bounded read that rejects FIFOs and devices without blocking. | |
| 109 | 110 | ||
| 111 | + | ## Performance | |
| 112 | + | ||
| 113 | + | Measured at `v0.1.0` (`3b1b6ef`, 2026-10-10) with Go 1.27.1 on linux/amd64 | |
| 114 | + | with an AMD Ryzen 9 7900X3D. Values are medians of 6 runs. The input is a | |
| 115 | + | realistic ~2.9 KB config of 100 lines with comments, 60 binds and 8 outputs. | |
| 116 | + | ||
| 117 | + | | Benchmark | Time/op | Throughput | Bytes/op | Allocs/op | | |
| 118 | + | |---|---:|---:|---:|---:| | |
| 119 | + | | `Parse` (file to entries) | 3.9 µs | 755 MB/s | 10.4 KiB | 5 | | |
| 120 | + | | `Unmarshal` (file to struct, maps included) | 12.5 µs | 232 MB/s | 21.7 KiB | 47 | | |
| 121 | + | | `Decode` (5 scalar entries) | 177 ns | | 112 B | 1 | | |
| 122 | + | | `Marshal` (struct to file) | 11.6 µs | | 15.5 KiB | 19 | | |
| 123 | + | | `Set` (edit one key in place) | 2.4 µs | | 10.5 KiB | 5 | | |
| 124 | + | | `Watch` (one write to one report, inotify) | 5.5 µs | | 256 B | 2 | | |
| 125 | + | ||
| 126 | + | Reproduce with: | |
| 127 | + | ||
| 128 | + | ```sh | |
| 129 | + | go test -run '^$' -bench . -benchmem -count 6 . | |
| 130 | + | ``` | |
| 131 | + | ||
| 110 | 132 | ## License | |
| 111 | 133 | ||
| 112 | 134 | MIT | |
| @@ -21,7 +21,8 @@ output.DP-1.scale = 1.5 | |||||
| 21 | - **Safe for real configs**: atomic saves, symlinked dotfiles, editors that | 21 | - **Safe for real configs**: atomic saves, symlinked dotfiles, editors that | ||
| 22 | save by rename, missing directories, broken files that keep the last good | 22 | save by rename, missing directories, broken files that keep the last good | ||
| 23 | config, and warnings that never print values (they may be secrets). | 23 | config, and warnings that never print values (they may be secrets). | ||
| 24 | - | - **Fast**: about 800 MB/s to parse, a few allocations per reported change. | 24 | + | - **Fast**: about 750 MB/s to parse, 2 allocations per reported change |
| 25 | + | (see [Performance](#performance)). | |||
| 25 | 26 | ||||
| 26 | ```sh | 27 | ```sh | ||
| 27 | go get github.com/bnema/kvconf | 28 | go get github.com/bnema/kvconf | ||
| @@ -107,6 +108,27 @@ skips saves that change no value. | |||||
| 107 | - `WriteFile`: atomic replace, written through symlinks. | 108 | - `WriteFile`: atomic replace, written through symlinks. | ||
| 108 | - `ReadFile`: bounded read that rejects FIFOs and devices without blocking. | 109 | - `ReadFile`: bounded read that rejects FIFOs and devices without blocking. | ||
| 109 | 110 | ||||
| 111 | + | ## Performance | |||
| 112 | + | ||||
| 113 | + | Measured at `v0.1.0` (`3b1b6ef`, 2026-10-10) with Go 1.27.1 on linux/amd64 | |||
| 114 | + | with an AMD Ryzen 9 7900X3D. Values are medians of 6 runs. The input is a | |||
| 115 | + | realistic ~2.9 KB config of 100 lines with comments, 60 binds and 8 outputs. | |||
| 116 | + | ||||
| 117 | + | | Benchmark | Time/op | Throughput | Bytes/op | Allocs/op | | |||
| 118 | + | |---|---:|---:|---:|---:| | |||
| 119 | + | | `Parse` (file to entries) | 3.9 µs | 755 MB/s | 10.4 KiB | 5 | | |||
| 120 | + | | `Unmarshal` (file to struct, maps included) | 12.5 µs | 232 MB/s | 21.7 KiB | 47 | | |||
| 121 | + | | `Decode` (5 scalar entries) | 177 ns | | 112 B | 1 | | |||
| 122 | + | | `Marshal` (struct to file) | 11.6 µs | | 15.5 KiB | 19 | | |||
| 123 | + | | `Set` (edit one key in place) | 2.4 µs | | 10.5 KiB | 5 | | |||
| 124 | + | | `Watch` (one write to one report, inotify) | 5.5 µs | | 256 B | 2 | | |||
| 125 | + | ||||
| 126 | + | Reproduce with: | |||
| 127 | + | ||||
| 128 | + | ```sh | |||
| 129 | + | go test -run '^$' -bench . -benchmem -count 6 . | |||
| 130 | + | ``` | |||
| 131 | + | ||||
| 110 | ## License | 132 | ## License | ||
| 111 | 133 | ||||
| 112 | MIT | 134 | MIT | ||