Skip to content

Instantly share code, notes, and snippets.

@jupj
jupj / Results
Created April 29, 2023 08:54
Benchmark for data-oriented design part 2
$ go test -bench=. data-oriented-design-benchmarks-2_test.go
Iterations Time Memory throughput Data processed
BenchmarkValueTypes/array-of-structs-4 121 9906752 ns/op 10497.89 MB/s 99.18 MB/op
BenchmarkValueTypes/struct-of-arrays-4 588 1974807 ns/op 586.80 MB/s 1.105 MB/op
BenchmarkRefTypes/array-of-references-4 127 9240654 ns/op 12120.35 MB/s 106.8 MB/op
BenchmarkRefTypes/struct-of-ref-arrays-4 123 9478477 ns/op 974.58 MB/s 8.810 MB/op
@jupj
jupj / Results
Last active March 12, 2023 13:21
Benchmark for data-oriented design
$ go test -bench=UnconfirmedEmail data-oriented-design-benchmarks_test.go
Iterations Time Memory throughput Data processed
BenchmarkUnconfirmedEmail/baseline-4 100 10673319 ns/op 9743.92 MB/s 99.18 MB/op
BenchmarkUnconfirmedEmail/data-oriented-4 582 2255190 ns/op 515.10 MB/s 1.108 MB/op