Tuple operations performance boost + fix logic bug#15376
Merged
Conversation
Member
|
💚 💙 💜 💛 ❤️ |
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.
Logic bug
Fixes a few tuple operation edge cases around negative tuple constraints. For example:
This is “all non-empty tuples”, so inserting at index 1 should work and produce
open_tuple([term(), boolean()])This also fixes the dynamic side of tuple operations, e.g.
tuple_delete_at(dynamic(tuple([integer(), atom()])), 2)now correctly returns :badindex instead of building an empty dynamic result.Performance boost
Finally, we apply the same projection shortcut we added for map operations: when working with projected negative constraints, avoid fully expanding the negative split if we can prove one projected side survives unchanged.
This makes projected-negative tuple operations faster on large types (for N=500 differences, on local benchmarks, we go from 8s for
fetchto 100ms, and 600ms forinsertops to 50ms).