Skip to content

Set: Optimize away isinst check#10860

Merged
cartermp merged 6 commits into
dotnet:mainfrom
buybackoff:set_step2
Jan 17, 2021
Merged

Set: Optimize away isinst check#10860
cartermp merged 6 commits into
dotnet:mainfrom
buybackoff:set_step2

Conversation

@buybackoff

Copy link
Copy Markdown
Contributor

Same as #10845

If OK, this PR includes the Map changes. The Map one could be closed and this merged, or will rebase.

Store height in leaves. Compared to the old discussion, when Left/Right were proposed to be stored in a universal node,
this adds 4 bytes to leaves or 2 bytes per item on average (vs 16/8).
`Match` produces `sub 1` and `switch` instruction. Here, for any non-trivial count,
nodes are more frequent than leaves on the path, so branch prediction should be beneficial.
@cartermp

Copy link
Copy Markdown
Contributor

@buybackoff No worries, we'll figure out the right merge strategy. I believe that because the changes are the same, it shouldn't matter if we take them independently.

@cartermp cartermp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good for set too (I mean, they're the same, but hey, looks good!)

@cartermp

Copy link
Copy Markdown
Contributor

@dsyme if you could take a look here as well that would be great.

@buybackoff just FYI - in case this does take time to merge - we have a policy of two approvals required for PRs. We relax that a bit when the changes are straightforward and/or tiny, but this will require two sign-offs to proceed since it affects such a core set of data structures.

@KevinRansom KevinRansom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants