From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzhcT-0008Io-Oa for qemu-devel@nongnu.org; Fri, 20 Nov 2015 04:04:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZzhcQ-0005S7-GS for qemu-devel@nongnu.org; Fri, 20 Nov 2015 04:04:37 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:35615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZzhcQ-0005Rv-9f for qemu-devel@nongnu.org; Fri, 20 Nov 2015 04:04:34 -0500 Received: by wmdw130 with SMTP id w130so11209477wmd.0 for ; Fri, 20 Nov 2015 01:04:33 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 20 Nov 2015 10:04:25 +0100 Message-Id: <1448010269-21694-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 0/4] qjson: save a lot of memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: armbru@redhat.com This patch from 2011 (!) saves about 96% of the allocation cost (down from 500 MiB to 20 MiB) for check-qjson. Paolo Paolo Bonzini (4): qjson: replace QString in JSONLexer with GString qjson: do not save/restore contexts qjson: store tokens in a GQueue qjson: surprise, allocating 6 QObjects per token is expensive include/qapi/qmp/json-lexer.h | 7 +- include/qapi/qmp/json-parser.h | 4 +- include/qapi/qmp/json-streamer.h | 16 +++- monitor.c | 2 +- qga/main.c | 2 +- qobject/json-lexer.c | 22 ++--- qobject/json-parser.c | 189 +++++++++++++++------------------------ qobject/json-streamer.c | 48 +++++----- qobject/qjson.c | 2 +- tests/libqtest.c | 2 +- 10 files changed, 125 insertions(+), 169 deletions(-) -- 2.5.0