On Sat, May 28, 2022 at 06:16:21PM +0100, Richard W.M. Jones wrote:
> 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
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
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
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 underlying bytes.
While the data copying might not be the bottleneck