https://github.com/marselester/perf
Performance tips
https://github.com/marselester/perf
Last synced: about 1 month ago
JSON representation
Performance tips
- Host: GitHub
- URL: https://github.com/marselester/perf
- Owner: marselester
- Created: 2024-06-29T01:37:04.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-08-15T01:30:33.000Z (9 months ago)
- Last Synced: 2025-04-05T13:42:51.247Z (about 2 months ago)
- Language: Go
- Size: 1.01 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Systems performance
Slides:
- [Go performance tips](https://go-talks.appspot.com/github.com/marselester/perf/go-tips.slide)
Use `present` tool to view the slides:
```sh
$ git clone https://github.com/marselester/perf.git
$ cd ./perf/
$ go run golang.org/x/tools/cmd/present -notes
```## Examples
```sh
# example/false-sharing
BenchmarkSumNaive-12 6451 181812 ns/op
BenchmarkSumPadded-12 9349 127138 ns/op
# example/loop-invariant
BenchmarkMultiplyNaive-12 2545 454713 ns/op
BenchmarkMultiplyInvariant-12 3445 342182 ns/op
# example/loop-tiling
BenchmarkAddNaive-12 634 1758105 ns/op
BenchmarkAddTiling-12 967 1168991 ns/op
# example/loop-unrolling
BenchmarkDotNaive-12 1401841 857.5 ns/op
BenchmarkDotUnroll-12 3035698 389.9 ns/op
BenchmarkDotBoundsCheckingElimination-12 4201716 281.9 ns/op
```