Optimization of mechanical properties of metallic parts