perf(GraphEngine): more caching

Added more agressive caching, regained about another 50% performance gain. Solar model over 10Gyr now takes roughly 400ms (as opposed to 1 second before)
This commit is contained in:
2025-12-06 16:35:35 -05:00
parent e95881d917
commit e48b62f231
3 changed files with 26 additions and 1 deletions

View File

@@ -882,6 +882,7 @@ namespace gridfire::engine {
mutable CppAD::ADFun<double> m_epsADFun; ///< CppAD function for the energy generation rate.
mutable CppAD::sparse_jac_work m_jac_work; ///< Work object for sparse Jacobian calculations.
mutable std::vector<double> m_local_abundance_cache;
mutable std::unordered_map<size_t, StepDerivatives<double>> m_stepDerivativesCache;
bool m_has_been_primed = false; ///< Flag indicating if the engine has been primed.