perf(GraphEngine): using caching clawed back ~10% performance
This commit is contained in:
@@ -875,6 +875,7 @@ namespace gridfire::engine {
|
||||
mutable CppAD::ADFun<double> m_rhsADFun; ///< CppAD function for the right-hand side of the ODE.
|
||||
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;
|
||||
|
||||
bool m_has_been_primed = false; ///< Flag indicating if the engine has been primed.
|
||||
|
||||
|
||||
@@ -809,6 +809,8 @@ namespace gridfire::reaction {
|
||||
std::vector<RateCoefficientSet> m_rates; ///< List of rate coefficient sets from each source.
|
||||
bool m_weak = false;
|
||||
|
||||
mutable std::unordered_map<double, double> m_cached_rates;
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Template implementation for calculating the total reaction rate.
|
||||
|
||||
Reference in New Issue
Block a user