Conversation
rjzamora
reviewed
Feb 6, 2024
| continue | ||
| seen.add(p._name) | ||
|
|
||
| column_union.extend(p._projection_columns) |
Member
There was a problem hiding this comment.
Is it worthwhile to have this in a if len(p.columns) > 0: block like before?
Collaborator
Author
There was a problem hiding this comment.
That is a very very rare case so I thought removing it is more efficient than keeping it, it’s only relevant for index projections, so the new logic should be more efficient in almost all cases
Comment on lines
-3204
to
+3205
| column_union = sorted( | ||
| flattened_columns, | ||
| key=lambda x: x[0] if isinstance(x, tuple) else x or MinType(), | ||
| ) | ||
| column_union = sorted(flattened_columns) |
Member
There was a problem hiding this comment.
Did something change here that I'm not seeing, or was the key= never necessary?
Collaborator
Author
There was a problem hiding this comment.
The logic changed a little bit, tuples now end up in the except branch. Since tuples are rare, it’s better to slow them down than to slow the default path down with the check
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.
cc @rjzamora
this cuts runtime in half on my machine, not super fancy but just avoids as much work as possible without changing the logic