<div dir="ltr"><div dir="ltr">On Mon, Feb 14, 2022 at 3:22 PM Eric Blake <<a href="mailto:eblake@redhat.com">eblake@redhat.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Feb 11, 2022 at 03:21:21AM +0200, Nir Soffer wrote:<br>
> Add unit tests and benchmarks for AioBuffer. The tests are trivial but<br>
> they server as running documentation, and they point out important<br>
<br>
serve<br></blockquote><div><br></div><div>Fixed</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> details about the type.<br>
> <br>
> The benchmarks show the efficiency of allocating a new buffer, zeroing<br>
> it, and interfacing with Go code.<br>
> <br>
> These tests will also ensure that we don't break anything by the next<br>
> changes.<br>
> <br>
> To run the benchmarks use:<br>
> <br>
> $ go test -run=xxx -bench=.<br>
> goos: linux<br>
> goarch: amd64<br>
> pkg: <a href="http://libguestfs.org/libnbd" rel="noreferrer" target="_blank">libguestfs.org/libnbd</a><br>
> cpu: Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz<br>
> BenchmarkMakeAioBuffer-12              6871759               157.2 ns/op<br>
> BenchmarkAioBufferZero-12                17551             69552 ns/op<br>
> BenchmarkFromBytes-12                     9632            139112 ns/op<br>
> BenchmarkAioBufferBytes-12               69375             16410 ns/op<br>
> PASS<br>
> ok    <a href="http://libguestfs.org/libnbd" rel="noreferrer" target="_blank">libguestfs.org/libnbd</a>   5.843s<br>
> <br>
> To make sure the benchmarks will not break, we run them in "make check"<br>
> with a very short timeout. For actual performance testing run "go test"<br>
> directly.<br>
<br>
Sounds good to me.<br></blockquote><div><br></div><div>Thanks, I'll push tomorrow if you don't have more comments.</div><div><br></div><div>Nir</div><div> </div></div></div>