From: Anthony Liguori <aliguori@us.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>,
Andreas Faerber <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH for-1.5 1/2] qom: aggressively optimize qom casting
Date: Mon, 13 May 2013 16:04:01 -0500 [thread overview]
Message-ID: <87r4haa8xq.fsf@codemonkey.ws> (raw)
In-Reply-To: <51915319.4090801@redhat.com>
Paolo Bonzini <pbonzini@redhat.com> writes:
> Il 13/05/2013 22:31, Anthony Liguori ha scritto:
>> This patch adds a small typename cache to ObjectClass. This allows
>> caching positive casts within each ObjectClass. Benchmarking a
>> PPC workload provided by Aurelien, this patch eliminates every
>> single g_hash_table_lookup() happening during the benchmark (which
>> was about 2 million per-second).
>>
>> With this patch applied, I get exactly the same performance (within
>> the margin of error) as with --disable-qom-cast-debug.
>>
>> N.B. it's safe to cache typenames only from the _assert() macros
>> because they are always called with string literals.
>
> Nice! Perhaps (for 1.6?) we can cache other results than class, so that
> interfaces are sped up as well.
Yes, there's no reason not to store any computed data within a class.
There are very few of them within QEMU and it's very easy to get to.
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Thanks. We should leave the --disable-qom-casts present for 1.5 but I'd
like to discuss reverting it for 1.6. I'll send patches once 1.6 opens
up.
Regards,
Anthony Liguori
next prev parent reply other threads:[~2013-05-13 21:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-13 20:31 [Qemu-devel] [PATCH for-1.5 1/2] qom: aggressively optimize qom casting Anthony Liguori
2013-05-13 20:31 ` [Qemu-devel] [PATCH for-1.5 2/2] qom: add casting statistics Anthony Liguori
2013-05-13 20:54 ` [Qemu-devel] [PATCH for-1.5 1/2] qom: aggressively optimize qom casting Paolo Bonzini
2013-05-13 21:04 ` Anthony Liguori [this message]
2013-05-13 21:13 ` Paolo Bonzini
2013-05-13 22:08 ` Peter Maydell
2013-05-14 0:38 ` Anthony Liguori
2013-05-14 16:11 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r4haa8xq.fsf@codemonkey.ws \
--to=aliguori@us.ibm.com \
--cc=afaerber@suse.de \
--cc=aurelien@aurel32.net \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).