Peter Maydell <peter.mayd...@linaro.org> writes: > On 13 May 2013 21:31, Anthony Liguori <aligu...@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