Received: from eggs.gnu.org ([2001:4830:134:3::10]:51448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0vAD-0006Np-NM for qemu-devel@nongnu.org; Mon, 23 Nov 2015 12:44:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0vAA-0000RT-8g for qemu-devel@nongnu.org; Mon, 23 Nov 2015 12:44:29 -0500 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:33519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0vAA-0000RP-2p for qemu-devel@nongnu.org; Mon, 23 Nov 2015 12:44:26 -0500 Received: by wmec201 with SMTP id c201so172497505wme.0 for ; Mon, 23 Nov 2015 09:44:25 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 23 Nov 2015 18:44:15 +0100 Message-Id: <1448300659-23559-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 v2 for-2.5? 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