optimize layout for cache performance

Move most commonly used fields to the beginning.