-
Notifications
You must be signed in to change notification settings - Fork 26
Rewrite internals for performance improvements #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Rewrites internals to use a height-balanced AVL tree (same as containers in Haskell) with an eye for performance. Most operations are 2-3x faster than the previous implementations, but specifically this targets set operations which were previously sub-optimal.
|
Result of running the benchmark comparison to current main: |
|
This comment is no longer relevant due to switching from a 2-3 tree to an AVL tree, right? If you don't plan on updating it, can the comment be removed? |
|
Can you clarify what comment you are referring to (perhaps a link to the full file). That link does not direct to something useful, likely because GH is collapsing diffs. |
This one (line 413): |
JordanMartinez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor things I found.
|
I'll remove the comment. It's not relevant anymore. |
|
On a separate note, for Could you clarify why? I assume most maps will not be empty, so does matching on the recursive case in |
I don't have a reason to believe this is necessarily the case compared to the other overhead. But I could make a benchmark to check equality performance. |
JordanMartinez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise.
I went ahead and did this. It seems to have a small effect for the main backend. |
|
Ok, cool. Is there anything else you want to do? Or is this ready to be merged? |
|
I have no other changes to make. |
|
Nice work ❤️ |
Description of the change
Rewrites internals to use a height-balanced AVL tree (same as containers in Haskell) with an eye for performance. Most operations are 2-3x faster than the previous implementations, but specifically this targets set operations which were previously sub-optimal.
The interface is exactly the same as before, except for the Internal module.
Checklist: