qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 for-2.5? 0/4] qjson: save a lot of memory


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v2 for-2.5? 0/4] qjson: save a lot of memory
Date: Wed, 25 Nov 2015 19:34:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Paolo Bonzini <address@hidden> writes:

> On 25/11/2015 15:47, Markus Armbruster wrote:
>> > This patch from 2011 (!) saves about 96% of the allocation cost (down
>> > from 500 MiB to 20 MiB) for check-qjson.
>> 
>> Looks good to me apart from the incomplete transition to recursive
>> descent in PATCH 2.
>
> I do not understand whether that is a problem.  Is the remark from the
> commit message incorrect ("Saving the parser context is mostly
> unnecessary; we can replace it with peeking at the next token, or remove
> it altogether when the restore only happens on errors.  The token list
> is destroyed anyway on errors.")?

The token sequence

    { 1 [ 2 ] }

gets parsed as [ 2 ].  See my reply to PATCH 2 for a more detailed
explanation.

I didn't bother to construct an example where QMP executes the incorrect
result, and I'm not sure it's possible.

Regardless, I'm fixing it, by simplifying the parser some more.



reply via email to

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