Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MA.operate!(+, pol1, pol2)
: prevent captured variable perf issue (#145
) The local function was spuriously recursive, making it not recursive fixes the performance problem. That is, this removes some run time dispatch and decreases the amount of allocation, but there's still some run time dispatch left in other places, according to JET.jl. Before: ```julia-repl julia> import MutableArithmetics; const MA = MutableArithmetics; julia> using DynamicPolynomials julia> @PolyVar x y; julia> p = 2x + y; julia> q = x + 2y; julia> @allocated MA.operate!(+, p, q) 34413936 ``` After: ```julia-repl julia> import MutableArithmetics; const MA = MutableArithmetics; julia> using DynamicPolynomials julia> @PolyVar x y; julia> p = 2x + y; julia> q = x + 2y; julia> @allocated MA.operate!(+, p, q) 30835632 ``` Both REPL runs was with nightly Julia v1.11.
- Loading branch information