Skip to content

Commit 702acbd

Browse files
adamhasselAdam Hasselbalch Hansen
andauthored
Update noise documentation slightly (#37)
Co-authored-by: Adam Hasselbalch Hansen <adam.hasselbalch.hansen@axon-networks.com>
1 parent 03b073b commit 702acbd

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test:
1313
go test -v ./...
1414

1515
bench-noise:
16-
go test -bench=. ./datamodel/noise
16+
go test -benchmem -bench=. ./datamodel/noise
1717

1818
gen-noise-preview:
1919
go test -tags=preview -v ./datamodel/noise -run TestGeneratePreviews

doc/noisegen.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,27 +105,28 @@ parameters for simulating your sensor, modify the `example_test.go` file and
105105
generate previews using the following command:
106106

107107
```
108-
go test -tags=preview -v ./datamodel/noise -run TestGeneratePreviews
108+
make gen-noise-preview
109109
```
110110

111111
## Performance
112112

113-
All generator algorithms are efficient and performance should not be a concern.
114-
To evaluate performance on your hardware, run the benchmarks using the following
115-
command:
113+
All generator algorithms are efficient zero-allocation functions and
114+
performance should not be a concern. To evaluate performance on your hardware,
115+
run the benchmarks using the following command:
116116

117117
```
118-
go test -bench=. ./datamodel/noise
118+
make bench-noise
119119
```
120120

121121
```
122122
goos: darwin
123123
goarch: arm64
124124
pkg: github.com/localhots/SimulaTR69/datamodel/noise
125125
cpu: Apple M3 Pro
126-
BenchmarkRandomWalk-11 189088714 6.164 ns/op
127-
BenchmarkPiecewiseLinear-11 166407223 7.205 ns/op
128-
BenchmarkSineWithNoise-11 100000000 10.98 ns/op
129-
BenchmarkPerlinNoise-11 127824692 9.442 ns/op
130-
BenchmarkTrendWithNoise-11 221975839 5.372 ns/op
126+
BenchmarkRandomWalk-11 189088714 6.164 ns/op 0 B/op 0 allocs/op
127+
BenchmarkPiecewiseLinear-11 166407223 7.205 ns/op 0 B/op 0 allocs/op
128+
BenchmarkSineWithNoise-11 100000000 10.98 ns/op 0 B/op 0 allocs/op
129+
BenchmarkPerlinNoise-11 127824692 9.442 ns/op 0 B/op 0 allocs/op
130+
BenchmarkTrendWithNoise-11 221975839 5.372 ns/op 0 B/op 0 allocs/op
131131
```
132+

0 commit comments

Comments
 (0)