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

Only copy sway relevant files into LSP tmp memory #5725

Merged
merged 11 commits into from
Mar 14, 2024

Conversation

JoshuaBatty
Copy link
Member

@JoshuaBatty JoshuaBatty commented Mar 13, 2024

Description

We were previously copying over every file in the users workspace. This meant that we were copying over a lot of unnecessary files. The language server only needs .sw files and Forc.toml and Forc.lock in temporary memory, so we now only copy over files that match this.

@JoshuaBatty JoshuaBatty marked this pull request as draft March 13, 2024 02:35
@JoshuaBatty JoshuaBatty self-assigned this Mar 13, 2024
@JoshuaBatty JoshuaBatty added the language server LSP server label Mar 13, 2024
@JoshuaBatty JoshuaBatty requested review from a team March 13, 2024 02:43
@JoshuaBatty JoshuaBatty marked this pull request as ready for review March 13, 2024 02:44
Copy link

Benchmark for 9d0a192

Click to view benchmark
Test Base PR %
code_action 5.2±0.02ms 5.2±0.15ms 0.00%
code_lens 289.2±12.48ns 294.2±7.33ns +1.73%
compile 6.3±0.10s 6.1±0.05s -3.17%
completion 4.8±0.12ms 4.8±0.10ms 0.00%
did_change_with_caching 5.7±0.16s 5.5±0.03s -3.51%
document_symbol 954.1±24.18µs 1012.4±25.47µs +6.11%
format 72.2±1.60ms 69.4±1.34ms -3.88%
goto_definition 362.6±8.46µs 359.9±6.26µs -0.74%
highlight 8.8±0.20ms 8.8±0.16ms 0.00%
hover 617.1±15.70µs 591.3±7.22µs -4.18%
idents_at_position 121.1±0.26µs 123.8±1.01µs +2.23%
inlay_hints 652.6±16.88µs 651.9±39.20µs -0.11%
on_enter 500.5±23.11ns 490.2±13.62ns -2.06%
parent_decl_at_position 3.6±0.02ms 3.6±0.02ms 0.00%
prepare_rename 360.6±7.71µs 354.7±9.24µs -1.64%
rename 9.3±0.27ms 9.2±0.03ms -1.08%
semantic_tokens 1029.1±27.51µs 1072.0±31.90µs +4.17%
token_at_position 352.8±4.53µs 351.9±2.33µs -0.26%
tokens_at_position 3.6±0.03ms 3.6±0.03ms 0.00%
tokens_for_file 409.6±3.09µs 405.9±2.45µs -0.90%
traverse 46.7±1.99ms 44.2±1.36ms -5.35%

sway-lsp/src/core/sync.rs Outdated Show resolved Hide resolved
Copy link

Benchmark for fd5adbf

Click to view benchmark
Test Base PR %
code_action 5.4±0.25ms 5.4±0.20ms 0.00%
code_lens 289.1±9.63ns 296.9±4.77ns +2.70%
compile 6.4±0.11s 6.3±0.09s -1.56%
completion 4.9±0.08ms 4.9±0.10ms 0.00%
did_change_with_caching 5.8±0.04s 5.9±0.06s +1.72%
document_symbol 950.2±27.66µs 956.0±28.34µs +0.61%
format 69.9±0.94ms 69.9±1.54ms 0.00%
goto_definition 359.2±7.75µs 364.4±7.05µs +1.45%
highlight 8.7±0.03ms 8.8±0.22ms +1.15%
hover 606.6±11.62µs 649.2±24.99µs +7.02%
idents_at_position 122.8±0.44µs 124.7±1.53µs +1.55%
inlay_hints 656.9±32.42µs 664.0±38.42µs +1.08%
on_enter 489.5±15.82ns 485.5±11.65ns -0.82%
parent_decl_at_position 3.6±0.07ms 3.6±0.07ms 0.00%
prepare_rename 358.2±5.84µs 361.5±7.35µs +0.92%
rename 9.2±0.19ms 9.3±0.33ms +1.09%
semantic_tokens 1051.1±15.82µs 1054.0±18.48µs +0.28%
token_at_position 358.8±2.32µs 354.7±3.77µs -1.14%
tokens_at_position 3.6±0.04ms 3.6±0.04ms 0.00%
tokens_for_file 411.0±2.06µs 410.8±4.97µs -0.05%
traverse 47.7±2.32ms 46.5±1.95ms -2.52%

@JoshuaBatty JoshuaBatty requested review from tritao and a team March 14, 2024 00:36
@JoshuaBatty JoshuaBatty enabled auto-merge (squash) March 14, 2024 00:36
Copy link

Benchmark for db29584

Click to view benchmark
Test Base PR %
code_action 5.2±0.02ms 5.2±0.08ms 0.00%
code_lens 292.8±10.09ns 288.5±8.55ns -1.47%
compile 6.1±0.03s 6.2±0.04s +1.64%
completion 4.8±0.02ms 4.8±0.09ms 0.00%
did_change_with_caching 5.5±0.03s 5.6±0.17s +1.82%
document_symbol 952.0±22.17µs 961.3±12.42µs +0.98%
format 69.8±1.25ms 70.4±1.63ms +0.86%
goto_definition 358.0±6.04µs 362.1±4.25µs +1.15%
highlight 8.7±0.04ms 8.7±0.02ms 0.00%
hover 608.4±42.29µs 601.1±19.74µs -1.20%
idents_at_position 122.2±0.53µs 124.6±0.64µs +1.96%
inlay_hints 657.6±25.83µs 660.6±20.36µs +0.46%
on_enter 492.1±14.69ns 501.0±12.36ns +1.81%
parent_decl_at_position 3.6±0.05ms 3.6±0.03ms 0.00%
prepare_rename 356.3±5.62µs 361.7±8.93µs +1.52%
rename 9.2±0.23ms 9.2±0.05ms 0.00%
semantic_tokens 1049.0±20.69µs 1064.9±32.34µs +1.52%
token_at_position 357.6±5.40µs 353.5±2.58µs -1.15%
tokens_at_position 3.6±0.05ms 3.6±0.11ms 0.00%
tokens_for_file 412.2±6.97µs 408.6±2.44µs -0.87%
traverse 44.7±1.47ms 46.3±2.45ms +3.58%

Copy link

Benchmark for 6bdfe96

Click to view benchmark
Test Base PR %
code_action 5.2±0.07ms 5.4±0.11ms +3.85%
code_lens 286.6±5.61ns 294.3±10.70ns +2.69%
compile 6.0±0.08s 6.1±0.06s +1.67%
completion 4.8±0.06ms 4.8±0.13ms 0.00%
did_change_with_caching 5.5±0.05s 5.5±0.02s 0.00%
document_symbol 956.7±17.30µs 1020.8±13.09µs +6.70%
format 69.5±0.79ms 69.6±0.61ms +0.14%
goto_definition 365.3±6.45µs 382.6±7.71µs +4.74%
highlight 8.7±0.02ms 9.0±0.08ms +3.45%
hover 636.0±19.32µs 622.2±24.28µs -2.17%
idents_at_position 122.9±1.31µs 121.3±0.33µs -1.30%
inlay_hints 660.0±13.04µs 666.6±47.86µs +1.00%
on_enter 485.4±9.34ns 516.3±19.66ns +6.37%
parent_decl_at_position 3.6±0.07ms 3.6±0.03ms 0.00%
prepare_rename 360.2±2.92µs 370.3±7.90µs +2.80%
rename 9.2±0.21ms 9.3±0.25ms +1.09%
semantic_tokens 1081.2±25.62µs 1055.1±27.33µs -2.41%
token_at_position 355.2±3.45µs 358.1±5.17µs +0.82%
tokens_at_position 3.6±0.03ms 3.6±0.03ms 0.00%
tokens_for_file 416.5±1.95µs 412.3±6.07µs -1.01%
traverse 44.4±1.49ms 44.1±1.58ms -0.68%

@JoshuaBatty JoshuaBatty requested a review from a team March 14, 2024 08:16
Copy link

Benchmark for 8ec476a

Click to view benchmark
Test Base PR %
code_action 5.5±0.06ms 5.4±0.11ms -1.82%
code_lens 295.5±7.66ns 289.7±17.07ns -1.96%
compile 6.1±0.10s 6.1±0.11s 0.00%
completion 5.0±0.08ms 5.0±0.43ms 0.00%
did_change_with_caching 5.6±0.08s 5.7±0.05s +1.79%
document_symbol 1021.6±39.38µs 976.4±18.01µs -4.42%
format 73.7±1.25ms 73.0±3.33ms -0.95%
goto_definition 365.3±4.65µs 365.4±17.15µs +0.03%
highlight 9.1±0.04ms 9.2±0.63ms +1.10%
hover 607.0±11.16µs 602.7±20.25µs -0.71%
idents_at_position 123.0±1.26µs 123.9±2.87µs +0.73%
inlay_hints 691.2±21.54µs 672.8±41.53µs -2.66%
on_enter 481.8±9.52ns 503.9±15.48ns +4.59%
parent_decl_at_position 3.7±0.04ms 3.7±0.03ms 0.00%
prepare_rename 362.4±6.56µs 361.2±6.01µs -0.33%
rename 9.7±0.42ms 9.6±0.23ms -1.03%
semantic_tokens 1048.8±16.37µs 1054.1±7.39µs +0.51%
token_at_position 362.6±2.25µs 358.6±1.64µs -1.10%
tokens_at_position 3.7±0.06ms 3.7±0.02ms 0.00%
tokens_for_file 425.0±1.50µs 416.2±1.98µs -2.07%
traverse 45.5±2.64ms 45.4±1.51ms -0.22%

Copy link

Benchmark for e9dd177

Click to view benchmark
Test Base PR %
code_action 5.4±0.14ms 5.4±0.02ms 0.00%
code_lens 292.2±10.06ns 286.8±7.61ns -1.85%
compile 6.1±0.07s 6.2±0.11s +1.64%
completion 5.1±0.11ms 4.9±0.02ms -3.92%
did_change_with_caching 5.7±0.09s 5.6±0.05s -1.75%
document_symbol 943.2±16.53µs 1000.3±29.30µs +6.05%
format 73.4±1.47ms 73.4±1.11ms 0.00%
goto_definition 363.5±7.04µs 357.0±6.97µs -1.79%
highlight 9.1±0.02ms 9.1±0.27ms 0.00%
hover 600.2±17.88µs 589.2±5.81µs -1.83%
idents_at_position 121.9±0.52µs 122.5±0.78µs +0.49%
inlay_hints 669.1±11.37µs 671.8±21.48µs +0.40%
on_enter 482.4±11.63ns 490.1±9.24ns +1.60%
parent_decl_at_position 3.7±0.26ms 3.7±0.03ms 0.00%
prepare_rename 362.8±7.91µs 358.5±9.20µs -1.19%
rename 9.5±0.06ms 9.5±0.18ms 0.00%
semantic_tokens 1042.7±40.78µs 1037.3±15.29µs -0.52%
token_at_position 363.9±3.21µs 357.2±2.18µs -1.84%
tokens_at_position 3.7±0.05ms 3.7±0.03ms 0.00%
tokens_for_file 418.9±2.19µs 411.8±7.95µs -1.69%
traverse 44.3±2.00ms 44.6±1.68ms +0.68%

Copy link

Benchmark for 59d92b7

Click to view benchmark
Test Base PR %
code_action 5.5±0.03ms 5.4±0.11ms -1.82%
code_lens 291.9±7.76ns 288.7±7.72ns -1.10%
compile 6.2±0.12s 6.1±0.09s -1.61%
completion 5.0±0.14ms 4.9±0.02ms -2.00%
did_change_with_caching 5.8±0.08s 5.6±0.07s -3.45%
document_symbol 955.6±28.23µs 954.2±21.22µs -0.15%
format 73.4±1.65ms 72.4±0.65ms -1.36%
goto_definition 374.2±5.09µs 354.7±5.54µs -5.21%
highlight 9.1±0.16ms 9.1±0.20ms 0.00%
hover 673.9±39.27µs 590.5±10.00µs -12.38%
idents_at_position 123.2±0.38µs 124.2±1.12µs +0.81%
inlay_hints 656.4±15.48µs 669.3±23.77µs +1.97%
on_enter 484.3±10.85ns 491.0±12.99ns +1.38%
parent_decl_at_position 3.7±0.04ms 3.7±0.10ms 0.00%
prepare_rename 359.9±4.54µs 354.2±7.72µs -1.58%
rename 9.6±0.16ms 9.5±0.11ms -1.04%
semantic_tokens 1014.3±13.44µs 1040.7±38.14µs +2.60%
token_at_position 355.7±1.78µs 354.9±2.17µs -0.22%
tokens_at_position 3.7±0.06ms 3.7±0.04ms 0.00%
tokens_for_file 416.0±1.89µs 407.6±2.72µs -2.02%
traverse 44.6±1.14ms 45.6±1.44ms +2.24%

Copy link

Benchmark for 589cf15

Click to view benchmark
Test Base PR %
code_action 5.6±0.11ms 5.5±0.07ms -1.79%
code_lens 288.6±7.03ns 290.4±10.94ns +0.62%
compile 6.4±0.12s 6.3±0.10s -1.56%
completion 5.0±0.12ms 4.9±0.06ms -2.00%
did_change_with_caching 5.8±0.04s 5.8±0.06s 0.00%
document_symbol 1006.5±33.07µs 1014.2±34.13µs +0.77%
format 70.6±1.60ms 70.6±1.92ms 0.00%
goto_definition 363.2±3.57µs 357.9±3.19µs -1.46%
highlight 9.2±0.18ms 9.1±0.15ms -1.09%
hover 597.8±19.96µs 605.9±17.54µs +1.35%
idents_at_position 122.1±0.38µs 123.5±1.06µs +1.15%
inlay_hints 690.8±34.08µs 672.4±24.34µs -2.66%
on_enter 510.8±12.35ns 495.4±24.32ns -3.01%
parent_decl_at_position 3.8±0.04ms 3.7±0.04ms -2.63%
prepare_rename 366.0±3.99µs 356.8±6.81µs -2.51%
rename 9.7±0.21ms 9.6±0.10ms -1.03%
semantic_tokens 1051.9±22.24µs 1043.8±20.16µs -0.77%
token_at_position 348.1±2.86µs 360.9±2.12µs +3.68%
tokens_at_position 3.7±0.04ms 3.7±0.01ms 0.00%
tokens_for_file 408.6±6.05µs 417.9±3.89µs +2.28%
traverse 45.5±1.37ms 45.1±1.36ms -0.88%

Copy link

Benchmark for 175df5e

Click to view benchmark
Test Base PR %
code_action 5.5±0.12ms 5.5±0.15ms 0.00%
code_lens 290.9±13.70ns 305.1±10.61ns +4.88%
compile 6.3±0.12s 6.2±0.16s -1.59%
completion 5.1±0.15ms 4.9±0.09ms -3.92%
did_change_with_caching 5.6±0.04s 5.8±0.07s +3.57%
document_symbol 1040.5±45.34µs 969.0±47.38µs -6.87%
format 70.3±1.19ms 70.1±1.68ms -0.28%
goto_definition 421.3±5.01µs 362.5±3.92µs -13.96%
highlight 9.2±0.18ms 9.1±0.02ms -1.09%
hover 647.3±15.51µs 602.5±12.24µs -6.92%
idents_at_position 123.9±0.70µs 122.9±0.55µs -0.81%
inlay_hints 699.4±21.44µs 678.5±22.28µs -2.99%
on_enter 511.8±21.23ns 499.8±14.97ns -2.34%
parent_decl_at_position 3.8±0.03ms 3.7±0.04ms -2.63%
prepare_rename 409.9±3.96µs 361.0±14.48µs -11.93%
rename 9.7±0.33ms 9.7±0.20ms 0.00%
semantic_tokens 1057.4±10.22µs 1057.7±6.76µs +0.03%
token_at_position 415.1±10.68µs 356.3±2.39µs -14.17%
tokens_at_position 3.8±0.03ms 3.7±0.02ms -2.63%
tokens_for_file 425.3±3.21µs 415.0±2.33µs -2.42%
traverse 44.7±2.19ms 46.4±1.76ms +3.80%

@JoshuaBatty JoshuaBatty merged commit 25d7e39 into master Mar 14, 2024
31 checks passed
@JoshuaBatty JoshuaBatty deleted the josh/lsp_tmp_memory branch March 14, 2024 22:47
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.

4 participants