[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 29/37] qapi: Eliminate empty visit_type_FOO_f
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v9 29/37] qapi: Eliminate empty visit_type_FOO_fields |
Date: |
Tue, 16 Feb 2016 21:57:18 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
On 01/25/2016 10:04 AM, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
>
>> For empty structs, such as the 'Abort' helper type used as part
>> of the 'transaction' command, we were emitting a no-op
>> visit_type_FOO_fields(). Optimize things to instead omit calls
>> for empty structs. Generated code changes resemble:
>>
>> Another reason for doing this optimization is that it gets us
>> closer to merging the code for visiting structs and unions:
>> since flat unions have no local members, they do not need to
>> have a visit_type_UNION_fields() emitted, even when they start
>> sharing the code used to visit structs.
>>
>
> I'm not sure the optimization is worthwhile by itself. Empty structs
> are rare. I'm reserving judgement until I see the struct/union
> unification.
We managed to pull off unification without this patch, and your argument
about making the generator more verbose with no-ops if it is less
maintenance is still resonating with me. I think I'm going to drop this
and 30/37 in my next round of patches, with no real loss in functionality.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v9 29/37] qapi: Eliminate empty visit_type_FOO_fields,
Eric Blake <=