[Libguestfs] [PATCH libnbd v2 1/9] golang: tests: Add test for AioBuffer

Nir Soffer nsoffer at redhat.com
Mon Feb 14 22:18:06 UTC 2022


On Mon, Feb 14, 2022 at 3:22 PM Eric Blake <eblake at redhat.com> wrote:

> On Fri, Feb 11, 2022 at 03:21:21AM +0200, Nir Soffer wrote:
> > Add unit tests and benchmarks for AioBuffer. The tests are trivial but
> > they server as running documentation, and they point out important
>
> serve
>

Fixed


>
> > details about the type.
> >
> > The benchmarks show the efficiency of allocating a new buffer, zeroing
> > it, and interfacing with Go code.
> >
> > These tests will also ensure that we don't break anything by the next
> > changes.
> >
> > To run the benchmarks use:
> >
> > $ go test -run=xxx -bench=.
> > goos: linux
> > goarch: amd64
> > pkg: libguestfs.org/libnbd
> > cpu: Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz
> > BenchmarkMakeAioBuffer-12              6871759               157.2 ns/op
> > BenchmarkAioBufferZero-12                17551             69552 ns/op
> > BenchmarkFromBytes-12                     9632            139112 ns/op
> > BenchmarkAioBufferBytes-12               69375             16410 ns/op
> > PASS
> > ok    libguestfs.org/libnbd   5.843s
> >
> > To make sure the benchmarks will not break, we run them in "make check"
> > with a very short timeout. For actual performance testing run "go test"
> > directly.
>
> Sounds good to me.
>

Thanks, I'll push tomorrow if you don't have more comments.

Nir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20220215/ca40cb6f/attachment.htm>


More information about the Libguestfs mailing list