qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori@us.ibm.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	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 19:38:32 -0500	[thread overview]
Message-ID: <87ehdal7jr.fsf@codemonkey.ws> (raw)
In-Reply-To: <CAFEAcA8-veq3N-8yBcLSwtZyJezrQxKVvaD1NaN7SC+VF3TCtQ@mail.gmail.com>

Peter Maydell <peter.maydell@linaro.org> writes:

> On 13 May 2013 21:31, Anthony Liguori <aliguori@us.ibm.com> wrote:
>> 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).
>
> That's a lot of hashtable lookups...

I suspect it's due to a cast somewhere in a path checking for pending
interrupts or something like that.  That would get called quite often.

>
>> --- a/include/qom/object.h
>> +++ b/include/qom/object.h
>> @@ -344,6 +344,8 @@ typedef void (ObjectUnparent)(Object *obj);
>>   */
>>  typedef void (ObjectFree)(void *obj);
>>
>> +#define OBJECT_CLASS_CAST_CACHE 4
>
> Total nitpick, but shouldn't this be
> OBJECT_CLASS_CAST_CACHE_SIZE ?

Ack, I need to respin anyway so I'll make the updates.

Thanks,

Anthony Liguori



>
> thanks
> -- PMM

  reply	other threads:[~2013-05-14  0:38 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
2013-05-13 21:13     ` Paolo Bonzini
2013-05-13 22:08 ` Peter Maydell
2013-05-14  0:38   ` Anthony Liguori [this message]
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=87ehdal7jr.fsf@codemonkey.ws \
    --to=aliguori@us.ibm.com \
    --cc=afaerber@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).