Performance optimizations for partitioning.