Optimizing the UI calculation speed