Commit Graph

5 Commits

Author SHA1 Message Date
Dan Kortschak b8d804e4ec ring: add tests/benchmark for WriterTo path and fix SIGSEGV error
Also add a call to ioutil.ReadAll to mimic the use in revid. There is
not a great deal of difference on the RPi3 in terms of throughput,
though the allocations obviously increase.

```
$ go test -run ^$ -bench . -benchmem -benchtime 30s
goos: linux
goarch: arm
BenchmarkRoundTrip-4           	    2000    20184818 ns/op    1.49 MB/s    104646 B/op    4 allocs/op
BenchmarkRoundTripWriterTo-4   	    2000    20175948 ns/op    1.49 MB/s       175 B/op    3 allocs/op
PASS
```
2018-06-06 17:53:15 +09:30
Dan Kortschak 4e1ae308ff ring: add multiple rewrite WriterTo to ring buffer API 2018-06-06 17:53:15 +09:30
Dan Kortschak a37923439c ring: add benchmark for roundtrip
Running this on a RPi3 gives the following:

```
$ go test -run ^$ -bench . -benchmem -benchtime 30s
goos: linux
goarch: arm
BenchmarkRoundTrip-4   	    2000	  20178499 ns/op	   1.49 MB/s	     174 B/op	       3 allocs/op
PASS
```
2018-06-06 17:53:15 +09:30
Dan Kortschak 2791939f34 ring: reverse time discounting 2018-06-06 17:53:15 +09:30
Dan Kortschak a4497c0ea4 ring: new package replacement for ringbuffer 2018-06-06 17:53:15 +09:30