Hash-cons BDD descriptors#15332
Open
gldubc wants to merge 1 commit intoelixir-lang:mainfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add hashes to every bdd nodes and bdd literal. Goal is to speed up comparisons, allow additional deep optimizations that test equality, and enable future caching of bdd operations.
Perfs:
this branch's perf:
The only real difference with main (included below) is that openapispex compiles much faster thanks to an added optimization.
for comparison, main perf:
The optimization mentioned above which helps openapispex, is l. 6135 optimization
{_, _, bdd, u, bdd} -> bdd_union(bdd, u)for bdd intersection. It brings down TC times from 280ms to 60ms with no change for others.The same l. 5828 opti (for bdd union) has a small or negligible impact overall, same for l. 5916 (for bdd difference).
Another note: since we have hashes now and it's cheap, I added simple equality checks for bdd union and intersection, e.g.
bdd_union(bdd, bdd), do: bdd