No there are many different optimization goals. CPU usage, Memory usage size, Memory bandwidth usage, Maintanability, Code complexity, etcpp. Many of which preclude each other.
Sounds like premature optimization. You're optimizing for some hypothetical edge case. If that actually was a problem it would be more cpu efficient to cache the result and update the cache in on_technology_researched (sacrificing memory and code complexity). If it *isn't* a problem then the cache is premature optimization again.PyroFire wrote: ↑Tue Oct 01, 2019 11:13 amNo, but you may need to call research_level for several different researches under several different functions in the same operation depending on what you're doing - Typically if you need to act based on the research level.eradicator wrote: ↑Sun Sep 29, 2019 9:55 amTechnology research state does not change "several times per tick". Whatever you're doing there is the wrong approach to the problem and you need to fix the approach, not the "solution".