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

New encoding fixes #5745

Merged
merged 11 commits into from
Mar 20, 2024
Merged

New encoding fixes #5745

merged 11 commits into from
Mar 20, 2024

Conversation

xunilrj
Copy link
Contributor

@xunilrj xunilrj commented Mar 18, 2024

Description

This PR contains three fixes:

1 - Fix to partial monomorphization. The fix was just removing a "quick-fix" that was merged and it is not needed anymore after #5684;
2 - To play safe, compile_fn_call cache will not be used for autogenerated code;
3 - experimental-new-encoding was not being copied in all cases.

Two other small changes are:

1 - Buffer struct does not offer a generic push anymore, because this function was extremely deceiving for primitive datatypes which have memory layouts very different from the encoding memory layout (u16, u32 etc...);
2 - Changing name of one test to make the test more obvious and easier to run just one specific test.

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

Copy link

Benchmark for 55eac41

Click to view benchmark
Test Base PR %
code_action 5.3±0.14ms 5.6±0.29ms +5.66%
code_lens 285.7±11.09ns 294.3±17.06ns +3.01%
compile 6.0±0.21s 5.9±0.08s -1.67%
completion 4.8±0.02ms 5.2±0.39ms +8.33%
did_change_with_caching 5.4±0.15s 5.6±0.20s +3.70%
document_symbol 948.7±19.04µs 1017.2±25.47µs +7.22%
format 70.8±0.99ms 70.8±4.24ms 0.00%
goto_definition 355.8±8.45µs 360.8±8.68µs +1.41%
highlight 8.8±0.29ms 9.0±0.19ms +2.27%
hover 585.0±8.07µs 597.4±14.10µs +2.12%
idents_at_position 121.3±0.99µs 121.3±0.75µs 0.00%
inlay_hints 687.9±96.38µs 666.4±40.00µs -3.13%
on_enter 496.2±15.98ns 489.3±17.17ns -1.39%
parent_decl_at_position 3.6±0.29ms 3.8±0.12ms +5.56%
prepare_rename 354.7±8.22µs 363.2±5.54µs +2.40%
rename 9.2±0.50ms 10.4±1.61ms +13.04%
semantic_tokens 1006.7±16.39µs 1046.1±14.79µs +3.91%
token_at_position 353.7±2.25µs 354.1±1.35µs +0.11%
tokens_at_position 3.6±0.08ms 3.7±0.05ms +2.78%
tokens_for_file 417.1±3.88µs 411.1±9.63µs -1.44%
traverse 44.2±1.45ms 45.3±1.88ms +2.49%

Copy link

Benchmark for 8a622c7

Click to view benchmark
Test Base PR %
code_action 5.3±0.11ms 5.5±0.22ms +3.77%
code_lens 284.7±9.06ns 290.4±11.72ns +2.00%
compile 6.0±0.09s 5.9±0.07s -1.67%
completion 4.8±0.11ms 4.9±0.11ms +2.08%
did_change_with_caching 5.4±0.04s 5.4±0.05s 0.00%
document_symbol 950.3±12.76µs 1018.5±24.47µs +7.18%
format 69.8±1.06ms 71.7±0.82ms +2.72%
goto_definition 359.9±7.97µs 360.0±5.06µs +0.03%
highlight 8.7±0.05ms 9.1±0.40ms +4.60%
hover 596.9±15.48µs 593.3±26.17µs -0.60%
idents_at_position 122.2±0.53µs 124.7±1.91µs +2.05%
inlay_hints 664.0±16.66µs 671.3±26.17µs +1.10%
on_enter 491.3±10.58ns 483.8±13.32ns -1.53%
parent_decl_at_position 3.6±0.05ms 3.7±0.26ms +2.78%
prepare_rename 355.2±7.31µs 365.1±8.96µs +2.79%
rename 9.3±0.44ms 9.5±0.19ms +2.15%
semantic_tokens 1038.9±21.34µs 1063.2±41.63µs +2.34%
token_at_position 350.3±2.77µs 353.6±3.00µs +0.94%
tokens_at_position 3.6±0.03ms 3.7±0.03ms +2.78%
tokens_for_file 416.5±4.72µs 422.7±1.91µs +1.49%
traverse 44.4±1.50ms 45.2±1.94ms +1.80%

Copy link

Benchmark for 088e4e1

Click to view benchmark
Test Base PR %
code_action 5.3±0.15ms 5.4±0.21ms +1.89%
code_lens 284.6±7.61ns 292.1±18.35ns +2.64%
compile 5.9±0.06s 5.8±0.08s -1.69%
completion 4.8±0.15ms 5.0±0.13ms +4.17%
did_change_with_caching 5.3±0.02s 5.3±0.07s 0.00%
document_symbol 969.5±29.56µs 1005.1±48.65µs +3.67%
format 69.6±1.59ms 70.0±1.34ms +0.57%
goto_definition 363.6±9.05µs 356.6±3.47µs -1.93%
highlight 8.8±0.25ms 9.0±0.24ms +2.27%
hover 598.8±30.18µs 594.6±12.87µs -0.70%
idents_at_position 121.6±0.38µs 123.0±1.26µs +1.15%
inlay_hints 653.0±36.86µs 664.0±20.11µs +1.68%
on_enter 478.3±14.68ns 482.3±12.94ns +0.84%
parent_decl_at_position 3.6±0.05ms 3.7±0.04ms +2.78%
prepare_rename 364.7±7.92µs 352.0±3.49µs -3.48%
rename 9.2±0.17ms 9.5±0.03ms +3.26%
semantic_tokens 1034.8±22.72µs 1061.9±19.23µs +2.62%
token_at_position 359.1±8.83µs 354.7±2.60µs -1.23%
tokens_at_position 3.6±0.29ms 3.7±0.03ms +2.78%
tokens_for_file 408.7±2.40µs 409.1±1.69µs +0.10%
traverse 43.2±1.34ms 44.3±1.62ms +2.55%

Copy link

Benchmark for 3d5a10b

Click to view benchmark
Test Base PR %
code_action 5.3±0.10ms 5.4±0.04ms +1.89%
code_lens 288.5±4.49ns 327.6±9.70ns +13.55%
compile 6.1±0.23s 5.8±0.12s -4.92%
completion 4.8±0.02ms 5.0±0.12ms +4.17%
did_change_with_caching 5.3±0.07s 5.2±0.02s -1.89%
document_symbol 958.4±24.40µs 984.7±40.83µs +2.74%
format 70.3±1.25ms 69.5±0.60ms -1.14%
goto_definition 369.8±9.46µs 362.8±10.80µs -1.89%
highlight 8.8±0.16ms 9.0±0.12ms +2.27%
hover 646.8±21.23µs 591.5±12.65µs -8.55%
idents_at_position 121.9±0.70µs 121.5±0.81µs -0.33%
inlay_hints 676.0±7.00µs 663.3±12.93µs -1.88%
on_enter 479.4±24.33ns 504.6±12.34ns +5.26%
parent_decl_at_position 3.6±0.04ms 3.7±0.03ms +2.78%
prepare_rename 371.2±7.91µs 361.6±3.30µs -2.59%
rename 9.3±0.22ms 9.5±0.01ms +2.15%
semantic_tokens 1042.2±17.24µs 1096.8±17.30µs +5.24%
token_at_position 366.3±1.74µs 363.9±2.25µs -0.66%
tokens_at_position 3.6±0.02ms 3.7±0.03ms +2.78%
tokens_for_file 416.2±4.11µs 415.1±1.66µs -0.26%
traverse 43.1±1.27ms 44.1±1.46ms +2.32%

@xunilrj xunilrj requested review from hal3e and a team March 19, 2024 09:37
@IGI-111 IGI-111 requested a review from a team March 20, 2024 03:16
Copy link

Benchmark for 0b768a0

Click to view benchmark
Test Base PR %
code_action 5.3±0.12ms 5.4±0.02ms +1.89%
code_lens 287.8±9.55ns 330.5±12.10ns +14.84%
compile 5.8±0.05s 5.9±0.08s +1.72%
completion 4.8±0.05ms 5.0±0.08ms +4.17%
did_change_with_caching 5.3±0.04s 5.4±0.05s +1.89%
document_symbol 996.3±39.98µs 1014.0±29.88µs +1.78%
format 69.8±1.19ms 70.2±1.22ms +0.57%
goto_definition 368.8±10.88µs 365.0±8.40µs -1.03%
highlight 8.9±0.82ms 9.1±0.05ms +2.25%
hover 603.8±13.45µs 598.7±15.92µs -0.84%
idents_at_position 121.5±0.43µs 123.2±1.42µs +1.40%
inlay_hints 648.9±11.19µs 670.2±22.75µs +3.28%
on_enter 474.0±14.83ns 487.1±15.71ns +2.76%
parent_decl_at_position 3.6±0.03ms 3.7±0.04ms +2.78%
prepare_rename 366.1±6.01µs 362.4±6.07µs -1.01%
rename 9.2±0.20ms 9.5±0.18ms +3.26%
semantic_tokens 1020.0±15.57µs 1122.9±32.72µs +10.09%
token_at_position 354.7±1.04µs 365.5±5.33µs +3.04%
tokens_at_position 3.6±0.02ms 3.7±0.03ms +2.78%
tokens_for_file 411.7±2.23µs 446.7±2.62µs +8.50%
traverse 43.5±1.77ms 44.0±1.35ms +1.15%

Copy link

Benchmark for 290e9e8

Click to view benchmark
Test Base PR %
code_action 5.3±0.09ms 5.4±0.07ms +1.89%
code_lens 285.4±7.16ns 328.6±9.81ns +15.14%
compile 5.9±0.08s 6.0±0.12s +1.69%
completion 4.9±0.03ms 4.9±0.10ms 0.00%
did_change_with_caching 5.4±0.06s 5.4±0.04s 0.00%
document_symbol 962.8±23.40µs 1002.3±47.18µs +4.10%
format 69.8±0.99ms 70.8±0.68ms +1.43%
goto_definition 369.9±7.39µs 364.4±3.54µs -1.49%
highlight 8.8±0.17ms 9.1±0.18ms +3.41%
hover 604.5±21.75µs 594.1±11.28µs -1.72%
idents_at_position 123.0±0.46µs 121.9±1.15µs -0.89%
inlay_hints 664.2±40.38µs 667.2±19.90µs +0.45%
on_enter 475.1±16.75ns 489.1±9.18ns +2.95%
parent_decl_at_position 3.6±0.03ms 3.7±0.05ms +2.78%
prepare_rename 369.6±7.46µs 364.4±5.44µs -1.41%
rename 9.2±0.17ms 9.5±0.05ms +3.26%
semantic_tokens 1077.4±23.46µs 1097.4±23.54µs +1.86%
token_at_position 366.9±1.86µs 362.8±1.96µs -1.12%
tokens_at_position 3.6±0.05ms 3.7±0.03ms +2.78%
tokens_for_file 414.3±1.66µs 421.3±1.68µs +1.69%
traverse 44.1±1.83ms 45.1±1.97ms +2.27%

@xunilrj xunilrj merged commit 98cdaac into master Mar 20, 2024
35 checks passed
@xunilrj xunilrj deleted the xunilrj/new-encoding-fixes branch March 20, 2024 08:54
@hal3e hal3e restored the xunilrj/new-encoding-fixes branch March 20, 2024 08:57
@hal3e hal3e deleted the xunilrj/new-encoding-fixes branch April 11, 2024 14: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.

3 participants