The need to move as much computation as possible outside of the
Plot loop is one that comes up again and again, perhaps most recently in Why is this 2D plot so slow?
I think we need a canonical Q&A for this problem that can serve as a master duplicate. It will need to address all common aspects of this issue.
To begin with I request help collecting links for the existing Q&A's that share this solution. From there we can identify all salient points and decide which Question, if any, is sufficiently clear and general enough to become canonical.
If you feel that this process should not take place vote down on this post. Otherwise please help as you feel inclined.