Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

peterzhu2118
Copy link
Member

Alternative implementation of #7683 where the feature is always enabled.

References from an old object to a write barrier protected young object will not immediately promote the young object. Instead, the young object will age just like any other object, meaning that it has to survive three collections before being promoted to the old generation. References from an old object to a write barrier unprotected object will place the parent object in the remember set for marking during minor collections. This allows the child object to be reclaimed in minor collections at the cost of increased time for minor collections.

On one of Shopify's highest traffic Ruby apps, Storefront Renderer, we saw significant improvements after deploying this feature in production. We compare the GC time and response time of web workers that have the original behaviour (non-experimental group) and this new behaviour (experimental group). We see that with this feature we spend significantly less time in the GC, 0.81x on average, 0.88x on p99, and 0.45x on p99.9.

This translates to improvements in average response time (0.96x) and p99 response time (0.92x).

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.

❤️

@peterzhu2118 peterzhu2118 force-pushed the pz-delay-promo-always branch from 951fa30 to 9c69736 Compare May 18, 2023 13:16
@peterzhu2118 peterzhu2118 changed the title [Feature #19610] Don't immediately promote children of old objects [Feature #19678] Don't immediately promote children of old objects May 18, 2023
[Feature #19678]

References from an old object to a write barrier protected young object
will not immediately promote the young object. Instead, the young object
will age just like any other object, meaning that it has to survive
three collections before being promoted to the old generation.
References from an old object to a write barrier unprotected object will
place the parent object in the remember set for marking during minor
collections. This allows the child object to be reclaimed in minor
collections at the cost of increased time for minor collections.

On one of [Shopify's highest traffic Ruby apps, Storefront
Renderer](https://shopify.engineering/how-shopify-reduced-storefront-response-times-rewrite),
we saw significant improvements after deploying this feature in
production. We compare the GC time and response time of web workers that
have the original behaviour (non-experimental group) and this new
behaviour (experimental group). We see that with this feature we spend
significantly less time in the GC, 0.81x on average, 0.88x on p99, and
0.45x on p99.9.

This translates to improvements in average response time (0.96x) and p99
response time (0.92x).
@peterzhu2118 peterzhu2118 force-pushed the pz-delay-promo-always branch from 9c69736 to 98b2b70 Compare May 18, 2023 13:21
@casperisfine
Copy link
Contributor

Can you update the PR and commit to reference https://bugs.ruby-lang.org/issues/19678 instead?

@peterzhu2118
Copy link
Member Author

I did, both the PR and commit references #19678.

@casperisfine
Copy link
Contributor

This was accepted right? Any blocker left on merging?

@peterzhu2118 peterzhu2118 merged commit e87f6c8 into ruby:master May 25, 2023
@peterzhu2118 peterzhu2118 deleted the pz-delay-promo-always branch May 25, 2023 12:56
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