Add a few optimizations to the interface layout system.