It turns out that it works extremely well. Not everything inherits from Object though, only high level objects that are long lived, SceneNodes for example are objects whereas vectors (not the container kind) are not.

It does sacrifice a bit of cache locality, but brings tremendous up sides with it, so it's well worth it. Also given that many objects can form one/many-to-many relationships with each other, you would lose that cache locality anyway (parent -> child relationships of scene nodes for example).

There are many classes which don't inherit from object because they don't need to, and some go as far as being trivial classes to allow for fast copy operations.

On the other hand, we have one construct that is explicitly out to blow cache locality: The weak object table! Rayne gained smart pointer support that nicely wrap the Object class, and one of the smart pointers is a weak pointer which stores a reference to the object at runtime in the weak table. The weak table is a multi level hash table, with the top level having 8 buckets. The buckets are allocated as one large memory chunk, but each bucket is sized to be larger than a CPU cache line, so in an ideal world multiple CPUs accessing the weak table don't suffer from false sharing.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com