[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 for-2.5 11/12] qjson: surprise, allocating 6
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v3 for-2.5 11/12] qjson: surprise, allocating 6 QObjects per token is expensive |
Date: |
Wed, 25 Nov 2015 15:31:09 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 11/25/2015 02:23 PM, Markus Armbruster wrote:
> From: Paolo Bonzini <address@hidden>
>
> Replace the contents of the tokens GQueue with a simple struct. This cuts
> the amount of memory allocated by tests/check-qjson from ~500MB to ~20MB,
> and the execution time from 600ms to 80ms on my laptop. Still a lot (some
> could be saved by using an intrusive list, such as QSIMPLEQ, instead of
> the GQueue), but the savings are already massive and the right thing to
> do would probably be to get rid of json-streamer completely.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> Message-Id: <address@hidden>
> [Straightforwardly rebased on my patches]
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> include/qapi/qmp/json-streamer.h | 7 +++
> qobject/json-parser.c | 115
> ++++++++++++++++-----------------------
> qobject/json-streamer.c | 19 +++----
> 3 files changed, 63 insertions(+), 78 deletions(-)
>
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v3 for-2.5 08/12] qjson: replace QString in JSONLexer with GString, (continued)
- [Qemu-devel] [PATCH v3 for-2.5 08/12] qjson: replace QString in JSONLexer with GString, Markus Armbruster, 2015/11/25
- [Qemu-devel] [PATCH v3 for-2.5 09/12] qjson: Convert to parser to recursive descent, Markus Armbruster, 2015/11/25
- [Qemu-devel] [PATCH v3 for-2.5 02/12] qjson: Don't crash when input exceeds nesting limit, Markus Armbruster, 2015/11/25
- [Qemu-devel] [PATCH v3 for-2.5 10/12] qjson: store tokens in a GQueue, Markus Armbruster, 2015/11/25
- [Qemu-devel] [PATCH v3 for-2.5 11/12] qjson: surprise, allocating 6 QObjects per token is expensive, Markus Armbruster, 2015/11/25
- Re: [Qemu-devel] [PATCH v3 for-2.5 11/12] qjson: surprise, allocating 6 QObjects per token is expensive,
Eric Blake <=
- [Qemu-devel] [PATCH v3 for-2.5 05/12] qjson: Give each of the six structural chars its own token type, Markus Armbruster, 2015/11/25