We consider the mass heterogeneity in a gas of polydisperse hard particles as a key to optimizing a dynamical property: the kinetic relaxation rate. Using the framework of the Boltzmann equation, we study the long time approach of a perturbed velocity distribution toward the equilibrium Maxwellian solution. We work out the cases of discrete as well as continuous distributions of masses, as found in dilute fluids of mesoscopic particles such as granular matter and colloids. On the basis of analytical and numerical evidence, we formulate a dynamical equipartition principle that leads to the result that no such continuous dispersion in fact minimizes the relaxation time, as the global optimum is characterized by a finite number of species. This optimal mixture is found to depend on the dimension d of space, ranging from five species for d=1 to a single one for d≥4. The role of the collisional kernel is also discussed, and extensions to dissipative systems are shown to be possible.