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

cache pid lock files to reduce IO operations #6297

Merged
merged 1 commit into from
Jul 25, 2024
Merged

Conversation

JoshuaBatty
Copy link
Member

@JoshuaBatty JoshuaBatty commented Jul 25, 2024

Description

Implements a new PidLockedFiles type for efficient file locking. Before this we were doing file IO on every did change key press event. We now cache the results for efficiency.

@JoshuaBatty JoshuaBatty requested a review from a team as a code owner July 25, 2024 02:34
@JoshuaBatty JoshuaBatty self-assigned this Jul 25, 2024
@JoshuaBatty JoshuaBatty requested a review from a team July 25, 2024 02:35
@JoshuaBatty JoshuaBatty added the language server LSP server label Jul 25, 2024
Copy link

Benchmark for 9b92bcc

Click to view benchmark
Test Base PR %
code_action 5.1±0.07ms 5.1±0.10ms 0.00%
code_lens 337.7±10.84ns 285.9±8.04ns -15.34%
compile 2.7±0.03s 2.6±0.05s -3.70%
completion 4.7±0.27ms 4.5±0.09ms -4.26%
did_change_with_caching 2.7±0.04s 2.6±0.05s -3.70%
document_symbol 892.9±23.27µs 930.2±22.04µs +4.18%
format 69.7±0.98ms 69.7±1.13ms 0.00%
goto_definition 343.5±6.00µs 340.0±6.38µs -1.02%
highlight 8.7±0.04ms 8.7±0.20ms 0.00%
hover 499.8±6.31µs 494.4±6.71µs -1.08%
idents_at_position 118.0±0.45µs 118.9±0.73µs +0.76%
inlay_hints 621.0±9.18µs 633.6±26.16µs +2.03%
on_enter 457.8±12.99ns 466.7±5.47ns +1.94%
parent_decl_at_position 3.6±0.04ms 3.6±0.06ms 0.00%
prepare_rename 342.4±3.24µs 341.4±10.26µs -0.29%
rename 9.0±0.12ms 9.1±0.20ms +1.11%
semantic_tokens 1280.2±13.38µs 1283.6±16.89µs +0.27%
token_at_position 340.4±3.63µs 342.3±2.99µs +0.56%
tokens_at_position 3.6±0.04ms 3.6±0.14ms 0.00%
tokens_for_file 403.2±4.48µs 406.8±3.89µs +0.89%
traverse 39.0±1.17ms 38.2±1.52ms -2.05%

@JoshuaBatty JoshuaBatty enabled auto-merge (squash) July 25, 2024 03:32
Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

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

Looks good!

@JoshuaBatty JoshuaBatty requested a review from a team July 25, 2024 06:16
@JoshuaBatty JoshuaBatty merged commit 62e7342 into master Jul 25, 2024
39 checks passed
@JoshuaBatty JoshuaBatty deleted the josh/cache_locks branch July 25, 2024 14:46
esdrubal pushed a commit that referenced this pull request Aug 13, 2024
## Description
Implements a new `PidLockedFiles` type for efficient file locking.
Before this we were do file IO on every did change key press event. We
now cache the results for efficiency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants