Skip to content
Snippets Groups Projects
Forked from Dynare / preprocessor
Loading
  • Sébastien Villemot's avatar
    7acf2783
    Performance improvement of chain rule derivation · 7acf2783
    Sébastien Villemot authored
    Commit 23b0c12d introduced caching in chain
    rule derivation (used by block decomposition), which increased speed for mfs >
    0, but actually decreased it for mfs=0.
    
    This patch introduces the pre-computation of derivatives which are known to be
    zero using symbolic a priori (similarly to what is done in the non-chain rule
    context). The algorithms are now identical between the two contexts (both
    symbolic a priori + caching), the difference being that in the chain rule
    context, the symbolic a priori and the cache are not stored within the ExprNode
    class, since they depend on the list of recursive variables.
    
    This patch brings a significant performant improvement for all values of the
    “mfs” option (the improvement is greater for small values of “mfs”).
    7acf2783
    History
    Performance improvement of chain rule derivation
    Sébastien Villemot authored
    Commit 23b0c12d introduced caching in chain
    rule derivation (used by block decomposition), which increased speed for mfs >
    0, but actually decreased it for mfs=0.
    
    This patch introduces the pre-computation of derivatives which are known to be
    zero using symbolic a priori (similarly to what is done in the non-chain rule
    context). The algorithms are now identical between the two contexts (both
    symbolic a priori + caching), the difference being that in the chain rule
    context, the symbolic a priori and the cache are not stored within the ExprNode
    class, since they depend on the list of recursive variables.
    
    This patch brings a significant performant improvement for all values of the
    “mfs” option (the improvement is greater for small values of “mfs”).