[Libguestfs] [PATCH libnbd 2/6] generator: Create only one Python wrapper per closure.

Eric Blake eblake at redhat.com
Tue Aug 13 11:15:12 UTC 2019


On 8/13/19 5:06 AM, Richard W.M. Jones wrote:
> We were previously generating one instance of the Python closure
> wrapper per (function * Closure arg).  However these wrappers didn't
> actually differ across functions.  We can therefore save a lot of code
> by only generating one wrapper per closure globally.
> 
> This reduces the amount of generated code by nearly 25%.  Before and
> after:
> 
> $ wc -l python/methods.c
> 3275 python/methods.c
> 
> $ wc -l python/methods.c
> 2662 python/methods.c

Keeping it as a separate patch makes sense.  It's a definite win.

ACK.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20190813/6a705184/attachment.sig>


More information about the Libguestfs mailing list