Use hashes instead of gensym id in PolyVar #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.