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

Do not force inling functions that have pointer args. #5762

Merged
merged 23 commits into from
Apr 16, 2024

Conversation

vaivaswatha
Copy link
Contributor

@vaivaswatha vaivaswatha commented Mar 23, 2024

The new encoding can handle functions with pointer arguments.

So this change reverts #4899. That PR also added a test which now passes without the forced inlining.

Also see #2819, which first introduced this hack.

The new encoding can handle functions with pointer arguments.

So this change reverts #4899.

Also see #2819, which first introduced this hack.
@vaivaswatha vaivaswatha self-assigned this Mar 23, 2024
Copy link

github-actions bot commented Apr 5, 2024

Benchmark for ba656bc

Click to view benchmark
Test Base PR %
code_action 5.5±0.08ms 5.5±0.09ms 0.00%
code_lens 293.9±43.45ns 287.2±8.05ns -2.28%
compile 5.9±0.10s 6.0±0.08s +1.69%
completion 5.0±0.08ms 4.9±0.08ms -2.00%
did_change_with_caching 5.4±0.05s 5.4±0.03s 0.00%
document_symbol 955.8±13.95µs 964.3±17.35µs +0.89%
format 71.4±1.76ms 70.2±0.62ms -1.68%
goto_definition 361.5±7.00µs 365.6±11.20µs +1.13%
highlight 9.1±0.06ms 9.1±0.11ms 0.00%
hover 646.9±47.83µs 617.6±15.64µs -4.53%
idents_at_position 123.1±0.36µs 122.4±0.75µs -0.57%
inlay_hints 665.6±35.38µs 661.9±31.18µs -0.56%
on_enter 495.7±18.50ns 500.0±27.74ns +0.87%
parent_decl_at_position 3.7±0.02ms 3.7±0.02ms 0.00%
prepare_rename 361.4±7.59µs 358.5±6.33µs -0.80%
rename 9.7±0.18ms 9.6±0.20ms -1.03%
semantic_tokens 1040.5±7.96µs 1051.1±22.17µs +1.02%
token_at_position 356.1±6.89µs 355.4±1.61µs -0.20%
tokens_at_position 3.7±0.03ms 3.7±0.03ms 0.00%
tokens_for_file 417.2±3.46µs 411.6±2.17µs -1.34%
traverse 43.8±1.49ms 43.6±1.65ms -0.46%

Copy link

github-actions bot commented Apr 5, 2024

Benchmark for aa0a9f8

Click to view benchmark
Test Base PR %
code_action 5.3±0.12ms 5.4±0.12ms +1.89%
code_lens 285.3±6.37ns 289.6±9.81ns +1.51%
compile 6.1±0.16s 6.0±0.13s -1.64%
completion 4.9±0.22ms 4.9±0.04ms 0.00%
did_change_with_caching 5.6±0.08s 5.6±0.07s 0.00%
document_symbol 959.7±13.53µs 959.5±15.72µs -0.02%
format 72.7±2.94ms 72.0±1.54ms -0.96%
goto_definition 368.0±10.34µs 363.4±11.32µs -1.25%
highlight 8.9±0.30ms 8.9±0.32ms 0.00%
hover 600.8±17.57µs 608.1±27.29µs +1.22%
idents_at_position 122.2±0.71µs 122.3±0.76µs +0.08%
inlay_hints 663.2±21.15µs 689.7±31.88µs +4.00%
on_enter 482.3±8.15ns 484.9±7.35ns +0.54%
parent_decl_at_position 3.6±0.11ms 3.6±0.23ms 0.00%
prepare_rename 362.5±5.99µs 361.3±7.93µs -0.33%
rename 9.2±0.33ms 9.4±0.35ms +2.17%
semantic_tokens 1047.7±39.30µs 1050.9±35.18µs +0.31%
token_at_position 355.5±3.30µs 362.7±5.69µs +2.03%
tokens_at_position 3.6±0.05ms 3.6±0.05ms 0.00%
tokens_for_file 412.1±3.92µs 412.5±6.38µs +0.10%
traverse 46.4±2.33ms 46.5±0.91ms +0.22%

Copy link

github-actions bot commented Apr 6, 2024

Benchmark for 301ca4b

Click to view benchmark
Test Base PR %
code_action 5.3±0.12ms 5.2±0.11ms -1.89%
code_lens 293.3±29.87ns 288.3±5.78ns -1.70%
compile 5.9±0.09s 5.8±0.06s -1.69%
completion 4.8±0.01ms 4.8±0.07ms 0.00%
did_change_with_caching 5.3±0.05s 5.3±0.04s 0.00%
document_symbol 1015.5±42.66µs 948.3±38.55µs -6.62%
format 73.2±1.19ms 71.0±1.33ms -3.01%
goto_definition 362.9±10.13µs 358.7±5.24µs -1.16%
highlight 8.7±0.14ms 8.7±0.17ms 0.00%
hover 599.0±26.48µs 588.1±12.08µs -1.82%
idents_at_position 122.3±0.36µs 122.0±0.54µs -0.25%
inlay_hints 657.4±16.47µs 655.7±23.41µs -0.26%
on_enter 490.8±13.36ns 487.9±7.75ns -0.59%
parent_decl_at_position 3.6±0.03ms 3.6±0.04ms 0.00%
prepare_rename 438.6±3.33µs 354.8±6.72µs -19.11%
rename 9.2±0.21ms 9.2±0.23ms 0.00%
semantic_tokens 1082.2±8.58µs 1066.3±23.14µs -1.47%
token_at_position 350.5±2.32µs 359.2±3.01µs +2.48%
tokens_at_position 3.6±0.05ms 3.6±0.01ms 0.00%
tokens_for_file 406.8±2.19µs 416.9±2.26µs +2.48%
traverse 43.8±2.33ms 43.4±1.45ms -0.91%

Copy link

github-actions bot commented Apr 6, 2024

Benchmark for 68ed183

Click to view benchmark
Test Base PR %
code_action 5.3±0.15ms 5.5±0.15ms +3.77%
code_lens 298.0±15.58ns 298.4±18.35ns +0.13%
compile 6.1±0.16s 5.9±0.07s -3.28%
completion 4.8±0.17ms 4.9±0.29ms +2.08%
did_change_with_caching 5.9±0.10s 5.4±0.04s -8.47%
document_symbol 963.6±31.93µs 953.9±21.96µs -1.01%
format 71.8±1.00ms 71.4±1.95ms -0.56%
goto_definition 361.6±7.30µs 367.8±3.63µs +1.71%
highlight 8.7±0.18ms 9.0±0.32ms +3.45%
hover 602.9±18.76µs 600.7±23.41µs -0.36%
idents_at_position 122.9±0.32µs 122.9±1.38µs 0.00%
inlay_hints 666.1±20.81µs 719.8±32.39µs +8.06%
on_enter 488.7±13.63ns 495.4±16.39ns +1.37%
parent_decl_at_position 3.6±0.02ms 3.8±0.08ms +5.56%
prepare_rename 358.9±7.57µs 364.3±7.14µs +1.50%
rename 9.2±0.07ms 9.5±0.36ms +3.26%
semantic_tokens 1051.1±43.79µs 1049.3±32.99µs -0.17%
token_at_position 355.7±2.31µs 362.3±3.02µs +1.86%
tokens_at_position 3.6±0.02ms 3.8±0.15ms +5.56%
tokens_for_file 410.7±3.44µs 414.4±1.86µs +0.90%
traverse 46.3±1.29ms 44.7±2.15ms -3.46%

Copy link

Benchmark for e0dbe75

Click to view benchmark
Test Base PR %
code_action 5.5±0.09ms 5.5±0.01ms 0.00%
code_lens 287.5±5.02ns 285.0±13.01ns -0.87%
compile 6.1±0.04s 6.0±0.04s -1.64%
completion 5.0±0.14ms 4.9±0.10ms -2.00%
did_change_with_caching 6.1±0.06s 6.2±0.08s +1.64%
document_symbol 957.6±12.50µs 986.0±27.04µs +2.97%
format 76.2±1.89ms 77.8±1.23ms +2.10%
goto_definition 359.6±5.72µs 367.6±7.01µs +2.22%
highlight 9.2±0.02ms 9.0±0.18ms -2.17%
hover 647.9±12.73µs 658.6±17.70µs +1.65%
idents_at_position 121.5±0.39µs 123.3±1.32µs +1.48%
inlay_hints 663.3±23.65µs 664.6±13.75µs +0.20%
on_enter 497.6±14.24ns 487.1±9.51ns -2.11%
parent_decl_at_position 3.7±0.02ms 3.7±0.03ms 0.00%
prepare_rename 353.7±6.04µs 365.0±6.77µs +3.19%
rename 9.6±0.13ms 9.6±0.31ms 0.00%
semantic_tokens 1070.3±18.10µs 1054.1±19.21µs -1.51%
token_at_position 352.1±2.47µs 353.3±4.56µs +0.34%
tokens_at_position 3.7±0.04ms 3.7±0.05ms 0.00%
tokens_for_file 412.7±2.09µs 414.7±2.07µs +0.48%
traverse 49.9±1.79ms 52.0±2.88ms +4.21%

Copy link

Benchmark for bbf41e4

Click to view benchmark
Test Base PR %
code_action 5.7±0.31ms 5.3±0.06ms -7.02%
code_lens 288.7±7.30ns 292.0±9.61ns +1.14%
compile 6.2±0.10s 6.3±0.08s +1.61%
completion 5.2±0.25ms 5.2±0.31ms 0.00%
did_change_with_caching 6.1±0.11s 6.5±0.16s +6.56%
document_symbol 964.9±12.50µs 978.3±19.39µs +1.39%
format 77.2±1.04ms 76.4±0.86ms -1.04%
goto_definition 368.9±6.86µs 366.3±6.97µs -0.70%
highlight 9.2±0.33ms 8.8±0.19ms -4.35%
hover 610.1±12.02µs 608.4±18.55µs -0.28%
idents_at_position 123.0±0.76µs 122.6±0.68µs -0.33%
inlay_hints 676.2±22.88µs 685.3±20.29µs +1.35%
on_enter 481.5±12.93ns 497.1±14.14ns +3.24%
parent_decl_at_position 3.8±0.15ms 3.6±0.05ms -5.26%
prepare_rename 366.9±7.12µs 369.6±7.40µs +0.74%
rename 9.7±0.19ms 9.3±0.22ms -4.12%
semantic_tokens 1043.0±21.66µs 1055.8±19.50µs +1.23%
token_at_position 362.1±2.68µs 356.9±3.53µs -1.44%
tokens_at_position 3.8±0.10ms 3.6±0.04ms -5.26%
tokens_for_file 413.3±4.42µs 409.9±1.89µs -0.82%
traverse 49.5±2.16ms 50.8±1.56ms +2.63%

Copy link

Benchmark for eee79c4

Click to view benchmark
Test Base PR %
code_action 5.5±0.10ms 5.3±0.16ms -3.64%
code_lens 301.8±51.30ns 288.4±7.65ns -4.44%
compile 6.3±0.10s 6.3±0.04s 0.00%
completion 5.0±0.19ms 4.8±0.14ms -4.00%
did_change_with_caching 6.2±0.10s 6.3±0.07s +1.61%
document_symbol 959.9±17.89µs 979.2±37.58µs +2.01%
format 76.0±0.66ms 77.4±0.95ms +1.84%
goto_definition 368.6±4.12µs 370.6±4.13µs +0.54%
highlight 9.1±0.24ms 8.8±0.23ms -3.30%
hover 613.7±19.64µs 603.3±23.85µs -1.69%
idents_at_position 122.7±0.29µs 122.4±0.39µs -0.24%
inlay_hints 668.6±20.33µs 655.3±18.56µs -1.99%
on_enter 484.6±18.34ns 492.3±13.41ns +1.59%
parent_decl_at_position 3.8±0.05ms 3.6±0.06ms -5.26%
prepare_rename 360.5±5.87µs 366.7±6.77µs +1.72%
rename 9.7±0.12ms 9.3±0.17ms -4.12%
semantic_tokens 1073.5±9.51µs 1040.3±11.40µs -3.09%
token_at_position 370.2±3.35µs 355.9±3.36µs -3.86%
tokens_at_position 3.8±0.04ms 3.6±0.07ms -5.26%
tokens_for_file 419.0±10.05µs 409.3±5.60µs -2.32%
traverse 51.9±2.97ms 50.6±2.17ms -2.50%

Copy link

Benchmark for dd1f013

Click to view benchmark
Test Base PR %
code_action 5.5±0.03ms 5.3±0.14ms -3.64%
code_lens 289.3±9.93ns 287.2±3.66ns -0.73%
compile 6.2±0.05s 6.3±0.10s +1.61%
completion 5.0±0.10ms 4.8±0.15ms -4.00%
did_change_with_caching 6.1±0.08s 6.3±0.07s +3.28%
document_symbol 955.0±6.33µs 963.7±25.79µs +0.91%
format 76.0±0.95ms 76.1±1.28ms +0.13%
goto_definition 364.6±9.24µs 366.2±8.25µs +0.44%
highlight 9.1±0.09ms 8.9±0.21ms -2.20%
hover 600.9±13.29µs 605.2±15.56µs +0.72%
idents_at_position 123.2±0.74µs 124.5±1.84µs +1.06%
inlay_hints 673.0±49.37µs 657.1±21.10µs -2.36%
on_enter 479.7±31.13ns 495.2±14.66ns +3.23%
parent_decl_at_position 3.7±0.03ms 3.6±0.07ms -2.70%
prepare_rename 365.0±5.06µs 368.3±6.15µs +0.90%
rename 9.6±0.13ms 9.3±0.24ms -3.12%
semantic_tokens 1053.0±18.89µs 1059.7±28.26µs +0.64%
token_at_position 357.2±3.14µs 363.4±1.75µs +1.74%
tokens_at_position 3.7±0.04ms 3.6±0.11ms -2.70%
tokens_for_file 418.1±7.61µs 408.8±7.12µs -2.22%
traverse 49.8±3.24ms 51.3±1.97ms +3.01%

@vaivaswatha vaivaswatha marked this pull request as ready for review April 12, 2024 02:52
@vaivaswatha vaivaswatha requested a review from a team April 12, 2024 02:52
sway-core/src/ir_generation/function.rs Outdated Show resolved Hide resolved
Copy link

Benchmark for f808181

Click to view benchmark
Test Base PR %
code_action 5.4±0.28ms 5.3±0.13ms -1.85%
code_lens 298.4±9.89ns 289.7±4.97ns -2.92%
compile 6.3±0.11s 6.5±0.16s +3.17%
completion 5.0±0.39ms 4.9±0.14ms -2.00%
did_change_with_caching 6.2±0.08s 6.4±0.14s +3.23%
document_symbol 1059.4±50.75µs 1039.4±42.72µs -1.89%
format 76.8±1.12ms 77.1±1.96ms +0.39%
goto_definition 368.8±8.45µs 370.9±10.41µs +0.57%
highlight 8.8±0.32ms 8.9±0.30ms +1.14%
hover 606.5±17.61µs 612.9±19.66µs +1.06%
idents_at_position 123.0±2.47µs 123.0±2.10µs 0.00%
inlay_hints 659.1±30.45µs 665.9±27.43µs +1.03%
on_enter 480.8±4.12ns 484.6±12.98ns +0.79%
parent_decl_at_position 3.6±0.08ms 3.6±0.08ms 0.00%
prepare_rename 365.9±5.84µs 365.3±6.89µs -0.16%
rename 9.3±0.10ms 9.3±0.32ms 0.00%
semantic_tokens 1056.4±23.23µs 1038.9±11.08µs -1.66%
token_at_position 364.9±4.46µs 359.8±3.88µs -1.40%
tokens_at_position 3.6±0.15ms 3.6±0.11ms 0.00%
tokens_for_file 414.5±3.77µs 417.2±5.40µs +0.65%
traverse 54.3±4.66ms 54.8±4.12ms +0.92%

Copy link

Benchmark for 11d1741

Click to view benchmark
Test Base PR %
code_action 5.3±0.09ms 5.4±0.07ms +1.89%
code_lens 301.8±15.07ns 294.9±8.01ns -2.29%
compile 6.2±0.06s 6.2±0.06s 0.00%
completion 4.8±0.08ms 4.9±0.10ms +2.08%
did_change_with_caching 6.1±0.06s 6.4±0.11s +4.92%
document_symbol 952.0±16.20µs 954.5±27.74µs +0.26%
format 76.8±2.57ms 75.8±2.20ms -1.30%
goto_definition 364.2±6.83µs 361.3±7.97µs -0.80%
highlight 8.7±0.15ms 8.7±0.16ms 0.00%
hover 605.5±20.15µs 604.7±8.46µs -0.13%
idents_at_position 123.1±0.42µs 123.9±0.77µs +0.65%
inlay_hints 657.8±42.64µs 658.3±27.89µs +0.08%
on_enter 492.4±17.86ns 505.3±14.13ns +2.62%
parent_decl_at_position 3.6±0.04ms 3.6±0.24ms 0.00%
prepare_rename 369.6±7.51µs 363.4±6.64µs -1.68%
rename 9.3±0.19ms 9.4±0.11ms +1.08%
semantic_tokens 1061.9±19.84µs 1030.6±20.67µs -2.95%
token_at_position 364.5±5.96µs 361.9±2.38µs -0.71%
tokens_at_position 3.6±0.02ms 3.6±0.05ms 0.00%
tokens_for_file 406.5±2.00µs 414.5±9.40µs +1.97%
traverse 50.2±1.23ms 49.8±2.02ms -0.80%

Copy link

Benchmark for 4cf6fac

Click to view benchmark
Test Base PR %
code_action 5.3±0.02ms 5.3±0.01ms 0.00%
code_lens 292.1±7.15ns 295.7±9.33ns +1.23%
compile 6.1±0.03s 6.2±0.05s +1.64%
completion 5.2±0.15ms 4.8±0.24ms -7.69%
did_change_with_caching 6.1±0.07s 6.4±0.12s +4.92%
document_symbol 961.6±13.21µs 1079.0±20.97µs +12.21%
format 75.4±1.07ms 78.8±1.21ms +4.51%
goto_definition 368.9±18.37µs 373.3±3.09µs +1.19%
highlight 8.8±0.06ms 8.8±0.18ms 0.00%
hover 632.1±25.89µs 606.0±16.20µs -4.13%
idents_at_position 123.9±0.40µs 123.5±1.22µs -0.32%
inlay_hints 664.4±17.18µs 672.4±13.26µs +1.20%
on_enter 486.1±16.27ns 486.3±6.84ns +0.04%
parent_decl_at_position 3.8±0.15ms 3.6±0.09ms -5.26%
prepare_rename 360.3±9.82µs 371.7±4.32µs +3.16%
rename 9.3±0.22ms 9.3±0.12ms 0.00%
semantic_tokens 1077.2±14.92µs 1059.8±18.51µs -1.62%
token_at_position 371.7±2.78µs 366.8±2.00µs -1.32%
tokens_at_position 4.1±0.23ms 3.6±0.05ms -12.20%
tokens_for_file 421.7±3.30µs 411.8±5.87µs -2.35%
traverse 49.9±1.28ms 50.0±1.46ms +0.20%

@vaivaswatha vaivaswatha requested a review from ironcev April 15, 2024 17:30
@vaivaswatha vaivaswatha enabled auto-merge (squash) April 16, 2024 11:00
Copy link

Benchmark for c402585

Click to view benchmark
Test Base PR %
code_action 5.6±0.38ms 5.3±0.20ms -5.36%
code_lens 297.3±13.36ns 297.7±4.92ns +0.13%
compile 6.2±0.09s 6.3±0.05s +1.61%
completion 4.9±0.19ms 4.8±0.03ms -2.04%
did_change_with_caching 6.4±0.10s 6.1±0.06s -4.69%
document_symbol 1006.3±30.47µs 1031.8±45.32µs +2.53%
format 74.9±0.41ms 78.8±1.45ms +5.21%
goto_definition 364.2±6.11µs 364.7±6.45µs +0.14%
highlight 8.8±0.62ms 8.8±0.23ms 0.00%
hover 595.5±12.27µs 617.4±24.10µs +3.68%
idents_at_position 122.4±0.98µs 123.2±2.11µs +0.65%
inlay_hints 659.7±38.17µs 659.4±31.36µs -0.05%
on_enter 484.2±16.30ns 502.2±14.24ns +3.72%
parent_decl_at_position 3.6±0.06ms 3.6±0.04ms 0.00%
prepare_rename 356.4±8.42µs 368.1±4.93µs +3.28%
rename 9.4±0.25ms 9.3±0.22ms -1.06%
semantic_tokens 1072.2±12.18µs 1014.9±9.95µs -5.34%
token_at_position 360.3±2.01µs 365.1±3.26µs +1.33%
tokens_at_position 3.6±0.04ms 3.6±0.04ms 0.00%
tokens_for_file 409.2±5.50µs 407.9±5.54µs -0.32%
traverse 50.9±1.16ms 49.9±2.13ms -1.96%

@vaivaswatha vaivaswatha merged commit b94d3d7 into master Apr 16, 2024
36 checks passed
@vaivaswatha vaivaswatha deleted the vaivaswatha/inline_pointer_args branch April 16, 2024 14:05
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