qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor
Date: Tue, 28 Jun 2016 08:14:14 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 06/28/2016 05:36 AM, Paolo Bonzini wrote:
> 
> 
> On 28/06/2016 11:01, Peter Lieven wrote:
>> this struct is approx 75kB
>>
>> Signed-off-by: Peter Lieven <address@hidden>
>> ---
>>  qapi/qmp-input-visitor.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> Can you change the stack to a QSLIST instead?  That's where most of the
> waste comes from.

QmpInputVisitor has:

struct QmpInputVisitor
{
    Visitor visitor;

    /* Root of visit at visitor creation. */
    QObject *root;

    /* Stack of objects being visited (all entries will be either
     * QDict or QList). */
    StackObject stack[QIV_STACK_SIZE];
...

while QmpOutputVisitor has:

struct QmpOutputVisitor
{
    Visitor visitor;
    QStack stack; /* Stack of containers that haven't yet been finished */
    QObject *root; /* Root of the output visit */
    QObject **result; /* User's storage location for result */
};

The extra layer of indirection to a QStack vs. a direct array has
tradeoffs, but both Markus and I have commented in the past that both
files' stacks are rather wasteful, and we just have not had a reason to
improve them.  This thread may be the reason :)

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]