cdaragorn / Ui-Info-Suite

Mod for Stardew Valley.
87 stars 369 forks source link

Cache data for advanced tooltip to prevent unnessecary recalculations. #42

Closed midorlo closed 3 years ago

midorlo commented 4 years ago

Caching this data (and any that may come later) we save rendering time.

Zamiell commented 3 years ago

This PR has been integrated in Annosz's fork: https://github.com/Annosz/UIInfoSuite2

cdaragorn commented 3 years ago

Caching can definitely be valuable, but this is not the way to do it here IMHO. A separate function should be used that is run less than the rendering loop so that you don't have to add all these if checks. Those alone mostly negate any advantages you gain from your cache.

Also please don't delete my commented sections or change my style.