Paolo Bonzini <pbonz...@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 <pbonz...@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