Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run signature blocks ahead of time and compact after indexing #2460

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

vinistock
Copy link
Member

Motivation

This PR adds two minor changes that may provide some performance gains.

Running all signatures ahead of time

This eliminates the need to run them on the first invocation of each method and eagerly unwraps the original method back in place. This will spend a bit more time during boot, but it should ensure that we see fewer of Sorbet's method wrapping logic in our stacks.

Compacting the GC after indexing

Indexing produces a lot of short lived objects for all of the ASTs of every file we interact with. This expands the heap pages a lot and may lead to some fragmentation. Compacting the GC helps us ensure that we're using the minimum number of pages needed and should make future GC runs a bit faster.

@vinistock vinistock added server This pull request should be included in the server gem's release notes other Changes that aren't bugfixes, enhancements or breaking changes labels Aug 19, 2024
@vinistock vinistock self-assigned this Aug 19, 2024
@vinistock vinistock requested a review from a team as a code owner August 19, 2024 15:12
@vinistock vinistock requested review from andyw8 and st0012 August 19, 2024 15:12
Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

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

On my machine I didn't notice any index/boot slowdown when running --time-index with this branch compared to main 👍

@vinistock vinistock merged commit 54584ff into main Aug 19, 2024
37 checks passed
@vinistock vinistock deleted the vs-add-sig-running-and-compaction branch August 19, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other Changes that aren't bugfixes, enhancements or breaking changes server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants