[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code
From: |
Daniel P . Berrangé |
Subject: |
Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code |
Date: |
Fri, 2 Feb 2018 16:44:46 +0000 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Fri, Feb 02, 2018 at 02:03:15PM +0100, Markus Armbruster wrote:
> Our qapi-schema.json is composed of modules connected by include
> directives, but the generated code is monolithic all the same: one
> qapi-types.h with all the types, one qapi-visit.h with all the
> visitors, and so forth. These monolithic headers get included all
> over the place. In my "build everyhing" tree, adding a QAPI type
> recompiles about 4500 out of 4800 objects.
>
> Nobody would write such monolithic headers by hand. It stands to
> reason that one shouldn't generate them, either.
>
> This series' basic idea is to split up generated headers to mirror the
> schema's modular structure: one header per module. That way, you can
> include just what you need.
>
> The series is RFC for a number of reasons:
>
> * The split is implemented only for qapi-types.h. That one should
> provide the biggest benefits, though.
>
> * There's a bit of code duplication.
>
> * I haven't re-read my patches, yet.
>
> Even in this incomplete state, the compile-time improvements can be
> massive. Before this series, any QAPI schema change recompiles some
> 4500 out of 4800 objects in my "build everything" tree. Afterwards,
> adding a type to qapi/migration.json recompiles less than 400, adding
> a QMP event recompiles less than 200, and a documentation change no
> longer recompiles anything.
Having gone through the same exercise for trace.h, I very much welcome
this effort for QAPI too !
If I consider the crypto stuff I maintain, the QAPI definitions are
in qapi/crypto.json.
>From my POV, I feel it would be natural to have them move to instead
be at crypto/qapi.json, and have the generated headers/source files be
crypto/qapi-types.h, crypto/qapi-visit.h, etc.
This would mirror what we did with tracing, crypto/trace-events, and
generating crypto/trace*.{c,h}
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- Re: [Qemu-devel] [PATCH RFC 16/21] qapi/types qapi/visit: Make visitors use QAPIGen more, (continued)
- [Qemu-devel] [PATCH RFC 05/21] qapi: Turn generators into modules, Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH RFC 10/21] qapi/common: Eliminate QAPISchema.exprs, Markus Armbruster, 2018/02/02
- [Qemu-devel] [PATCH RFC 17/21] qapi/types qapi/visit: Generate built-in stuff into separate files, Markus Armbruster, 2018/02/02
- Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code,
Daniel P . Berrangé <=
- Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code, no-reply, 2018/02/02
- Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code, no-reply, 2018/02/02
- Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code, no-reply, 2018/02/02
- Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code, no-reply, 2018/02/02
- Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code, no-reply, 2018/02/02
- Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code, Markus Armbruster, 2018/02/03