JuliaAlgebra / MultivariatePolynomials.jl

Multivariate polynomials interface
https://juliaalgebra.github.io/MultivariatePolynomials.jl/stable/
Other
135 stars 27 forks source link

Narrow `convert` methods to reduce invalidations #172

Closed timholy closed 3 years ago

timholy commented 3 years ago

This package caused >1000 invalidations for DifferentialEquations. The main problem is a pair of convert methods: one is redundant with a method in Base (and needlessly invalidates some code), and another intersected with signatures like convert(Base.SHA1, ::Any) and other crazy types. The reason is because the T in APL{T} is completely unconstrained, and consequently it's possible in principle for it to be a REPLTerminal or a Module or whatever. It didn't seem as if that were the real intent of the convert method, but I'm just guessing that this won't break anything.

I have not run the full tests locally but :crossed_fingers:

CC @ChrisRackauckas

Some background in another package: https://github.com/JuliaData/CategoricalArrays.jl/issues/177