Basic optimization for particle systems.