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

Major Performance Boost in line_col Function with bytecount Integration #5440

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

JoshuaBatty
Copy link
Member

Description

This PR introduces a significant performance improvement to the line_col function by integrating the bytecount crate, leading to more efficient newline character counting in strings. Here are the results of the sway-lsp benchmarks. 🚀

Type Previous Duration Current Duration Speedup Improvement %
highlight 108.30 ms 14.704 ms 7.36x +86.44%
tokens_at_position 41.317 ms 6.9646 ms 5.93x +83.14%
parent_decl_at_position 41.319 ms 6.9321 ms 5.96x +83.22%
traverse 165.60 ms 28.811 ms 5.75x +82.60%
code_action 58.034 ms 10.734 ms 5.41x +81.52%
rename 119.33 ms 11.773 ms 10.14x +90.14%
completion 48.597 ms 13.809 ms 3.52x +71.59%
inlay_hints 8.6783 ms 6.0263 ms 1.44x +30.52%
format 46.893 ms 43.834 ms 1.07x +6.52%
compile 1.1505 s 1.0962 s 1.05x +4.71%
code_lens 231.30 ns 221.57 ns 1.04x +4.21%
hover 6.1517 ms 5.9984 ms 1.03x +2.49%
tokens_for_file 8.2928 ms 8.0658 ms 1.03x +2.73%
on_enter 307.96 ns 300.81 ns 1.02x +2.32%
document_symbol 6.1988 ms 6.7087 ms 0.92x -7.90%
token_at_position 6.0207 ms 5.9769 ms 1.01x +0.73%
idents_at_position 3.2212 ms 3.1946 ms 1.01x +0.83%
did_change_with_caching 175.55 ms 174.16 ms 1.01x +0.79%
prepare_rename 6.0136 ms 6.0365 ms 1.00x -0.38%
semantic_tokens 16.790 ms 17.340 ms 0.97x -3.28%
goto_definition 5.9613 ms 6.0710 ms 0.98x -1.84%

@JoshuaBatty JoshuaBatty self-assigned this Jan 8, 2024
@JoshuaBatty JoshuaBatty added language server LSP server compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen labels Jan 8, 2024
@JoshuaBatty JoshuaBatty requested review from a team January 8, 2024 05:20
@JoshuaBatty JoshuaBatty merged commit 1ac7f3c into master Jan 8, 2024
35 checks passed
@JoshuaBatty JoshuaBatty deleted the josh/line_col branch January 8, 2024 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen language server LSP server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants