Open saschatimme opened 5 years ago
Uh I completely ignored the order problem. Right now people create implicitly a variable order. Just replacing this by alphabetic order is probably not nice. This would also be super breaking and probably not desirable.
any recent thoughts on this?
I am starting to more and more dislike the use of the gensym()
id. This generates problems with multiple workers and make it also practical infeasible to store variables on disc (since then you load things and get easily a collision with the ids).
But I also think that there are only very breaking ways out of this... So it's not clear for me what (or even if) something should be done.
If the current way of doing things is not feasible long-term, better to rip off the bandaid sooner rather than later.
We could make it work now with the variable order field
This addresses #20 coming from the recent observation that in distributed code (with
Distributed
)gensym
doesn't guarantee unique variable ids anymore.I used the following script to benchmark:
The results for one run of the current master are:
and for this PR:
But I have to note that these tests are super noisy, the same benchmark a couple minutes earlier (again the PR branch):
My conclusion is that this does not introduce any significant performance impact and that we spend most our time in other code parts anyway.
The change would have the benefits that we are more consistent with regard to how variables are handled in the MultivariatePolynomials universe. Also I have to admit that the accidental redeclaration of variables resulted a couple of times in quite some head scratching. Also this addresses the problems related to parallel code.