Optimizing application performance using temperature feedback