From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHtmn-00086X-0T for qemu-devel@nongnu.org; Tue, 28 Jun 2016 10:14:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHtmb-0003o5-LC for qemu-devel@nongnu.org; Tue, 28 Jun 2016 10:14:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHtmT-0003nf-JV for qemu-devel@nongnu.org; Tue, 28 Jun 2016 10:14:33 -0400 References: <1467104499-27517-1-git-send-email-pl@kamp.de> <1467104499-27517-8-git-send-email-pl@kamp.de> <8ded21b5-dde9-28a4-72b1-f89ba59c4136@redhat.com> From: Eric Blake Message-ID: <57728636.3090200@redhat.com> Date: Tue, 28 Jun 2016 08:14:14 -0600 MIME-Version: 1.0 In-Reply-To: <8ded21b5-dde9-28a4-72b1-f89ba59c4136@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0HORxwb9CVw86Q7bi0u2rAT5SjqvX0mDw" Subject: Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Peter Lieven , qemu-devel@nongnu.org Cc: kwolf@redhat.com, peter.maydell@linaro.org, mst@redhat.com, dgilbert@redhat.com, mreitz@redhat.com, kraxel@redhat.com, Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0HORxwb9CVw86Q7bi0u2rAT5SjqvX0mDw From: Eric Blake To: Paolo Bonzini , Peter Lieven , qemu-devel@nongnu.org Cc: kwolf@redhat.com, peter.maydell@linaro.org, mst@redhat.com, dgilbert@redhat.com, mreitz@redhat.com, kraxel@redhat.com, Markus Armbruster Message-ID: <57728636.3090200@redhat.com> Subject: Re: [Qemu-devel] [PATCH 07/15] qapi: use mmap for QmpInputVisitor References: <1467104499-27517-1-git-send-email-pl@kamp.de> <1467104499-27517-8-git-send-email-pl@kamp.de> <8ded21b5-dde9-28a4-72b1-f89ba59c4136@redhat.com> In-Reply-To: <8ded21b5-dde9-28a4-72b1-f89ba59c4136@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 06/28/2016 05:36 AM, Paolo Bonzini wrote: >=20 >=20 > On 28/06/2016 11:01, Peter Lieven wrote: >> this struct is approx 75kB >> >> Signed-off-by: Peter Lieven >> --- >> qapi/qmp-input-visitor.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > Can you change the stack to a QSLIST instead? That's where most of the= > waste comes from. QmpInputVisitor has: struct QmpInputVisitor { Visitor visitor; /* Root of visit at visitor creation. */ QObject *root; /* Stack of objects being visited (all entries will be either * QDict or QList). */ StackObject stack[QIV_STACK_SIZE]; =2E.. while QmpOutputVisitor has: struct QmpOutputVisitor { Visitor visitor; QStack stack; /* Stack of containers that haven't yet been finished *= / QObject *root; /* Root of the output visit */ QObject **result; /* User's storage location for result */ }; The extra layer of indirection to a QStack vs. a direct array has tradeoffs, but both Markus and I have commented in the past that both files' stacks are rather wasteful, and we just have not had a reason to improve them. This thread may be the reason :) --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --0HORxwb9CVw86Q7bi0u2rAT5SjqvX0mDw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXcoY2AAoJEKeha0olJ0NqjNMH/ApJzGNhyQKIhfGYcsdpBGDp 1Z1SgscX+Tt2iDIHsVudcOMtYyUBI4GiwLVkN8trCopzVSgz2cXqN4hd2r4hbvuV T4RZL3oAYp1FKX30IjpPRXiQc6HkqE0kvJOjEjK9lzuz9covOE90g9kCFt2GcZlN RGVEpJlXfeOLsGsftQh6l9bQa3U1mWyMZqT/pOgYm00jkJt7qa85SAli+I8YoyI5 RDh0VGqn6Se8YKNf0oKgKqorhCVmxHB3csfdO2OIeaXrrTRD3qu2ln8ViuMcaX/p BlqILV8Ja3XitS/iw0ZMBcE7EWobD76h10i0Rb7rNMNr8v/GAxeDCrPbFXsS56s= =dywX -----END PGP SIGNATURE----- --0HORxwb9CVw86Q7bi0u2rAT5SjqvX0mDw--