[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.
Re: [Qemu-devel] [PATCH v2 2/4] qjson: do not save/restore contexts, Markus Armbruster, 2015/11/25
[Qemu-devel] [PATCH v2 3/4] qjson: store tokens in a GQueue, Paolo Bonzini, 2015/11/23
[Qemu-devel] [PATCH v2 4/4] qjson: surprise, allocating 6 QObjects per token is expensive, Paolo Bonzini, 2015/11/23
Re: [Qemu-devel] [PATCH v2 for-2.5? 0/4] qjson: save a lot of memory, Eric Blake, 2015/11/23
Re: [Qemu-devel] [PATCH v2 for-2.5? 0/4] qjson: save a lot of memory, Markus Armbruster, 2015/11/25