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... > --- 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 ? thanks -- PMM