Skip to content

Conversation

peterzhu2118
Copy link
Member

The RARRAY_LITERAL_FLAG was added in commit 5871ecf to improve CoW performance for array literals by not keeping track of reference counts.

This commit reverts that commit and has an alternate implementation that is more generic for all frozen arrays. Since frozen arrays cannot be modified, we don't need to set the RARRAY_SHARED_ROOT_FLAG and we don't need to do reference counting.

@peterzhu2118 peterzhu2118 requested a review from byroot July 22, 2022 15:22
@peterzhu2118 peterzhu2118 force-pushed the pz-frozen-array-shared-root branch from 608952a to 5af5e80 Compare July 22, 2022 15:23
Copy link
Member

@byroot byroot left a comment

Choose a reason for hiding this comment

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

💯

The RARRAY_LITERAL_FLAG was added in commit
5871ecf to improve CoW performance for
array literals by not keeping track of reference counts.

This commit reverts that commit and has an alternate implementation that
is more generic for all frozen arrays. Since frozen arrays cannot be
modified, we don't need to set the RARRAY_SHARED_ROOT_FLAG and we don't
need to do reference counting.
@peterzhu2118 peterzhu2118 force-pushed the pz-frozen-array-shared-root branch from 5af5e80 to 4df8a2e Compare July 22, 2022 15:38
@peterzhu2118 peterzhu2118 merged commit e199ae3 into ruby:master Jul 22, 2022
@peterzhu2118 peterzhu2118 deleted the pz-frozen-array-shared-root branch July 22, 2022 17:29
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.

2 participants