Polymorphism avoidance

A related technique replaces a single array of polymorphic object pointers, or worse, a big ad hoc graph structure of them, with several arrays, one for each specific static object type.

We first get rid of polymorphism, sparing us a vtable indirection, and second, manually ensure a nice contiguous placement of data. Now instead of iterating over a single data structure we have several arrays to be considered. Well, the code gets somehow uglier, but this inconvenience is the price paid for better performance. Remember—it's a trade-off.

This technique is also known as data-oriented design (DoD) and an implementation of the CSS animation system was reported to run six times faster than an original OO implementation after a rewrite took place along these lines.