8000 bestEffortCommit the cache after writing the VERSION_KEY by jez · Pull Request #8878 · sorbet/sorbet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

bestEffortCommit the cache after writing the VERSION_KEY #8878

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

Merged
merged 1 commit into from
May 16, 2025
Merged

Conversation

jez
Copy link
Collaborator
@jez jez commented May 15, 2025

Motivation

This is just a slight performance optimization. When the cache is cold,
we would write the VERSION_KEY but forget to commit the transaction.
This meant that the first write to the cache when processing files would
defensively abort any previous transaction, causing the VERSION_KEY to
get written again.

It's not clear that this should be user visible, and it's really not a
big performance win, but it looks nicer in the logs because we see
write, commit, write, commit, write, commit, instead of write, drop,
write, commit, write, commit.

Test plan

Not possible to test except by looking in the trace-level logs.

This is just a slight performance optimization. When the cache is cold,
we would write the VERSION_KEY but forget to commit the transaction.
This meant that the first write to the cache when processing files would
defensively abort any previous transaction, causing the VERSION_KEY to
get written again.

It's not clear that this should be user visible, and it's really not a
big performance win, but it looks nicer in the logs because we see
write, commit, write, commit, write, commit, instead of write, drop,
write, commit, write, commit.
@jez jez requested a review from a team as a code owner May 15, 2025 23:29
@jez jez requested review from elliottt and removed request for a team May 15, 2025 23:29
@jez jez merged commit e551876 into master May 16, 2025
14 checks passed
@jez jez deleted the jez-commit branch May 16, 2025 00:01
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
0