Re: [Libguestfs] [libnbd PATCH] api: Speed up nbd_pread_structured when reading holes

2022-05-28 Thread Richard W.M. Jones
On Fri, May 27, 2022 at 05:25:43PM -0500, Eric Blake wrote: > Commit c7fbc71d missed an optimization: when we guarantee that a pread > buffer is pre-zeroed, we don't need to waste time memset()ing it when > the server sends a hole. But the next commit e0953cb7 lets the user > skip pre-zeroing, at

Re: [Libguestfs] [libnbd PATCH] python: Speed up pread

2022-05-28 Thread Richard W.M. Jones
On Fri, May 27, 2022 at 04:44:16PM -0500, Eric Blake wrote: > Instead of malloc'ing a C buffer, nbd_pread()ing into it, then copying > it into an immutable Python bytes object, we can instead pre-create a > correctly-sized Python bytearray object, then nbd_pread() directly > into that object's