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

Fix Bytes, Vec and String buffer ownership #6142

Merged
merged 31 commits into from
Jul 8, 2024

Conversation

xunilrj
Copy link
Contributor

@xunilrj xunilrj commented Jun 19, 2024

Description

This PR fixes a problem with std::Bytes, std::Vec and std::String buffer ownership. It also fixes a problem with buffer overflow when encoding huge types.

Buffer Ownership

Currently, types like Bytes, Vec and String do not guarantee ownership of their buffer. That means that we can very easily alias the underlying buffer and change its mutability by simply creating a new instance.

For example:

let some_slice = ...;
let buffer = Bytes::from(some_slice);
let mut buffer2 = buffer.clone();
// Now I can change `some_slice`

Type Inference bug

I also had to fix a small problem with the type inference of method applications. The problem is that sometimes the type check does not return an error on the first pass, but the type is still not concrete.

For example x.get(0) == Some(2), becomes eq(x.get(0), Some(2)).

After the first pass, x.get(0) is correctly inferred to be Option<u8>; but Some(2) is only typed as Option<Numeric>. This happens because the first pass starts with TypeInfo::Unknown. We can use the argument types here because they may still be non-concrete types like "Self".

What the fix is doing is that it checks if the inferred type is_concrete, assuming that Numeric is not. This will make "Some(2)" be type-checked again at the second pass, after monomorphization and be correctly typed as "Option".

IR Verification errors

This PR also improves the error message for IR verification. Now the error is shown inside the printed IR.

image

Script to update contract-ids (optional)

At test/update-contract-ids.sh there is a small script that automatically updates contract ids. Unfortunately, given the indirect nature of contract calls, it is impossible for the script to know which contract it needs to compile. So we need to specify the path to the contract.

We also need to pass the compiler flags, because in some cases we use debug profile, and in others we use release.

const FUEL_COIN_CONTRACT_ID = 0x1a88d0982d216958d18378b6784614b75868a542dc05f8cc85cf3da44268c76c; // AUTO-CONTRACT-ID ../../test_contracts/test_fuel_coin_contract --release

In the example above, the path and flags are appended in the bash script. I failed trying to inject commands, so I think the append is safe.

I can remove this from the PR, if we find that this is not the solution we want at the moment.

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 746b0fa

Click to view benchmark
Test Base PR %
code_action 5.1±0.19ms 5.2±0.02ms +1.96%
code_lens 297.6±11.39ns 288.6±10.79ns -3.02%
compile 3.6±0.08s 3.5±0.08s -2.78%
completion 4.7±0.11ms 4.9±0.20ms +4.26%
did_change_with_caching 3.3±0.07s 3.4±0.09s +3.03%
document_symbol 915.9±49.74µs 938.5±27.40µs +2.47%
format 88.3±1.39ms 88.8±1.83ms +0.57%
goto_definition 351.9±7.92µs 349.0±4.00µs -0.82%
highlight 8.7±0.19ms 9.0±0.20ms +3.45%
hover 570.4±7.85µs 575.4±6.25µs +0.88%
idents_at_position 118.5±0.61µs 121.5±2.08µs +2.53%
inlay_hints 647.2±24.25µs 655.7±43.99µs +1.31%
on_enter 457.0±15.81ns 466.8±19.63ns +2.14%
parent_decl_at_position 3.6±0.06ms 3.7±0.07ms +2.78%
prepare_rename 350.6±7.29µs 351.1±5.81µs +0.14%
rename 9.3±0.34ms 9.3±0.26ms 0.00%
semantic_tokens 1275.8±20.92µs 1296.3±13.33µs +1.61%
token_at_position 337.9±3.87µs 342.3±3.26µs +1.30%
tokens_at_position 3.6±0.11ms 3.7±0.04ms +2.78%
tokens_for_file 405.2±24.51µs 403.8±6.10µs -0.35%
traverse 39.2±1.25ms 38.7±0.55ms -1.28%

Copy link

Benchmark for 63595e5

Click to view benchmark
Test Base PR %
code_action 5.1±0.15ms 5.1±0.10ms 0.00%
code_lens 288.3±6.15ns 293.5±7.68ns +1.80%
compile 3.6±0.06s 3.4±0.10s -5.56%
completion 4.6±0.01ms 4.7±0.16ms +2.17%
did_change_with_caching 3.3±0.06s 3.2±0.09s -3.03%
document_symbol 925.7±21.26µs 858.5±18.06µs -7.26%
format 88.1±0.66ms 87.6±2.37ms -0.57%
goto_definition 350.1±4.58µs 373.3±12.53µs +6.63%
highlight 8.7±0.15ms 8.8±0.17ms +1.15%
hover 574.1±5.42µs 571.6±5.80µs -0.44%
idents_at_position 119.2±0.35µs 119.9±0.99µs +0.59%
inlay_hints 634.5±25.14µs 635.8±22.63µs +0.20%
on_enter 456.7±9.04ns 478.2±32.11ns +4.71%
parent_decl_at_position 3.6±0.05ms 3.6±0.04ms 0.00%
prepare_rename 347.3±6.00µs 358.2±7.44µs +3.14%
rename 8.9±0.15ms 9.0±0.22ms +1.12%
semantic_tokens 1263.3±12.53µs 1249.7±7.71µs -1.08%
token_at_position 335.1±1.84µs 331.5±2.48µs -1.07%
tokens_at_position 3.5±0.04ms 3.6±0.04ms +2.86%
tokens_for_file 398.0±2.57µs 402.7±2.43µs +1.18%
traverse 38.2±0.72ms 37.1±1.45ms -2.88%

@xunilrj xunilrj force-pushed the xunilrj/make-bytes-own-buffer branch from ef917df to 51fa76d Compare June 22, 2024 09:22
Copy link

Benchmark for 04f1b88

Click to view benchmark
Test Base PR %
code_action 5.2±0.17ms 5.1±0.15ms -1.92%
code_lens 292.2±13.24ns 291.7±12.40ns -0.17%
compile 3.6±0.07s 3.6±0.09s 0.00%
completion 4.7±0.22ms 4.7±0.18ms 0.00%
did_change_with_caching 3.4±0.08s 3.3±0.07s -2.94%
document_symbol 942.9±49.35µs 922.9±48.96µs -2.12%
format 88.4±1.18ms 88.8±1.27ms +0.45%
goto_definition 339.5±6.19µs 340.7±4.45µs +0.35%
highlight 8.7±0.15ms 8.7±0.02ms 0.00%
hover 559.2±7.27µs 570.7±4.75µs +2.06%
idents_at_position 118.2±0.83µs 118.1±0.55µs -0.08%
inlay_hints 630.9±8.97µs 639.0±10.65µs +1.28%
on_enter 456.3±16.33ns 467.9±18.61ns +2.54%
parent_decl_at_position 3.6±0.07ms 3.6±0.05ms 0.00%
prepare_rename 338.7±7.81µs 343.2±9.40µs +1.33%
rename 9.0±0.06ms 9.0±0.07ms 0.00%
semantic_tokens 1245.6±12.09µs 1269.1±12.78µs +1.89%
token_at_position 337.6±2.41µs 341.8±2.31µs +1.24%
tokens_at_position 3.6±0.04ms 3.6±0.07ms 0.00%
tokens_for_file 405.1±2.83µs 402.2±1.95µs -0.72%
traverse 38.8±1.04ms 38.5±0.56ms -0.77%

Copy link

Benchmark for 15ecc8e

Click to view benchmark
Test Base PR %
code_action 5.1±0.14ms 5.2±0.04ms +1.96%
code_lens 292.1±6.32ns 292.1±8.17ns 0.00%
compile 3.5±0.09s 3.5±0.08s 0.00%
completion 4.7±0.12ms 4.8±0.10ms +2.13%
did_change_with_caching 3.2±0.05s 3.2±0.07s 0.00%
document_symbol 850.8±17.64µs 855.2±27.06µs +0.52%
format 87.7±1.39ms 87.0±0.65ms -0.80%
goto_definition 336.3±8.25µs 367.7±12.76µs +9.34%
highlight 8.7±0.04ms 9.1±0.24ms +4.60%
hover 567.5±4.73µs 595.8±13.01µs +4.99%
idents_at_position 119.0±0.45µs 120.3±0.74µs +1.09%
inlay_hints 639.9±21.92µs 708.3±22.34µs +10.69%
on_enter 458.6±14.57ns 467.0±23.22ns +1.83%
parent_decl_at_position 3.5±0.02ms 3.7±0.02ms +5.71%
prepare_rename 334.3±8.54µs 364.6±5.91µs +9.06%
rename 8.9±0.20ms 9.4±0.15ms +5.62%
semantic_tokens 1222.7±15.35µs 1315.9±16.58µs +7.62%
token_at_position 333.3±8.22µs 337.4±3.16µs +1.23%
tokens_at_position 3.6±0.10ms 3.7±0.03ms +2.78%
tokens_for_file 402.8±2.53µs 403.1±3.35µs +0.07%
traverse 37.3±1.01ms 36.2±0.63ms -2.95%

@xunilrj xunilrj force-pushed the xunilrj/make-bytes-own-buffer branch from 2231a36 to 0184dad Compare June 24, 2024 13:00
Copy link

Benchmark for 2fd48e5

Click to view benchmark
Test Base PR %
code_action 5.0±0.10ms 5.0±0.12ms 0.00%
code_lens 302.5±9.05ns 294.5±7.19ns -2.64%
compile 3.4±0.08s 3.4±0.09s 0.00%
completion 4.6±0.03ms 4.6±0.10ms 0.00%
did_change_with_caching 3.1±0.06s 3.2±0.09s +3.23%
document_symbol 886.1±41.45µs 936.3±21.13µs +5.67%
format 86.7±0.64ms 87.4±1.29ms +0.81%
goto_definition 335.5±8.10µs 339.6±5.24µs +1.22%
highlight 8.6±0.18ms 8.7±0.43ms +1.16%
hover 557.6±22.46µs 573.4±4.39µs +2.83%
idents_at_position 120.3±1.72µs 119.4±1.09µs -0.75%
inlay_hints 625.7±13.70µs 637.0±34.77µs +1.81%
on_enter 466.3±11.38ns 456.6±12.48ns -2.08%
parent_decl_at_position 3.5±0.03ms 3.6±0.06ms +2.86%
prepare_rename 335.7±2.65µs 340.1±7.86µs +1.31%
rename 8.9±0.03ms 8.9±0.02ms 0.00%
semantic_tokens 1234.7±15.94µs 1283.4±13.40µs +3.94%
token_at_position 330.8±2.41µs 334.3±1.88µs +1.06%
tokens_at_position 3.5±0.03ms 3.6±0.04ms +2.86%
tokens_for_file 397.6±2.79µs 402.7±3.81µs +1.28%
traverse 35.9±0.63ms 36.3±0.88ms +1.11%

Copy link

Benchmark for 3cc7e6d

Click to view benchmark
Test Base PR %
code_action 5.1±0.04ms 5.1±0.17ms 0.00%
code_lens 290.6±8.60ns 292.1±10.87ns +0.52%
compile 3.6±0.09s 3.4±0.07s -5.56%
completion 4.6±0.03ms 4.6±0.12ms 0.00%
did_change_with_caching 3.2±0.06s 3.2±0.07s 0.00%
document_symbol 870.1±33.34µs 866.9±17.33µs -0.37%
format 88.0±1.08ms 87.7±1.92ms -0.34%
goto_definition 336.8±6.12µs 344.6±6.86µs +2.32%
highlight 8.8±0.24ms 8.7±0.23ms -1.14%
hover 570.6±9.37µs 572.0±5.57µs +0.25%
idents_at_position 120.9±1.34µs 119.6±1.11µs -1.08%
inlay_hints 718.7±23.12µs 641.0±26.34µs -10.81%
on_enter 471.3±12.84ns 452.6±9.52ns -3.97%
parent_decl_at_position 3.6±0.07ms 3.5±0.02ms -2.78%
prepare_rename 338.1±3.36µs 345.0±4.88µs +2.04%
rename 9.1±0.18ms 8.9±0.08ms -2.20%
semantic_tokens 1236.2±14.84µs 1287.1±13.91µs +4.12%
token_at_position 338.0±9.78µs 336.5±2.92µs -0.44%
tokens_at_position 3.6±0.08ms 3.5±0.02ms -2.78%
tokens_for_file 404.7±5.98µs 404.3±2.67µs -0.10%
traverse 37.1±1.27ms 36.9±0.87ms -0.54%

Copy link

Benchmark for f92675f

Click to view benchmark
Test Base PR %
code_action 5.1±0.10ms 5.1±0.10ms 0.00%
code_lens 292.5±11.99ns 293.0±9.82ns +0.17%
compile 3.6±0.10s 3.5±0.09s -2.78%
completion 4.8±0.21ms 4.6±0.08ms -4.17%
did_change_with_caching 3.3±0.08s 3.3±0.08s 0.00%
document_symbol 872.6±36.88µs 876.2±11.01µs +0.41%
format 88.7±2.13ms 88.2±1.60ms -0.56%
goto_definition 340.2±9.51µs 344.4±5.80µs +1.23%
highlight 8.7±0.29ms 8.7±0.29ms 0.00%
hover 568.0±10.52µs 568.4±20.16µs +0.07%
idents_at_position 120.2±0.68µs 118.0±2.43µs -1.83%
inlay_hints 631.4±22.54µs 630.7±17.90µs -0.11%
on_enter 467.7±10.69ns 474.6±13.61ns +1.48%
parent_decl_at_position 3.6±0.06ms 3.6±0.03ms 0.00%
prepare_rename 339.1±9.25µs 342.8±6.58µs +1.09%
rename 9.0±0.31ms 9.0±0.20ms 0.00%
semantic_tokens 1256.5±21.30µs 1264.1±19.21µs +0.60%
token_at_position 332.9±2.98µs 336.0±2.43µs +0.93%
tokens_at_position 3.6±0.08ms 3.6±0.05ms 0.00%
tokens_for_file 400.3±2.29µs 401.7±7.35µs +0.35%
traverse 38.0±0.42ms 37.5±0.46ms -1.32%

@xunilrj xunilrj force-pushed the xunilrj/make-bytes-own-buffer branch from 993f345 to 1d49b98 Compare June 25, 2024 07:32
Copy link

Benchmark for 5ff35a0

Click to view benchmark
Test Base PR %
code_action 5.1±0.10ms 5.1±0.03ms 0.00%
code_lens 310.3±11.28ns 296.4±10.91ns -4.48%
compile 3.4±0.08s 3.4±0.07s 0.00%
completion 4.6±0.04ms 4.6±0.01ms 0.00%
did_change_with_caching 3.2±0.07s 3.2±0.06s 0.00%
document_symbol 846.1±25.41µs 921.3±47.13µs +8.89%
format 87.1±0.77ms 87.3±0.61ms +0.23%
goto_definition 336.9±8.68µs 342.6±7.77µs +1.69%
highlight 8.6±0.16ms 8.7±0.03ms +1.16%
hover 560.3±6.05µs 563.9±6.87µs +0.64%
idents_at_position 119.4±0.44µs 118.5±1.00µs -0.75%
inlay_hints 677.1±27.23µs 626.0±23.95µs -7.55%
on_enter 465.5±17.24ns 476.1±12.48ns +2.28%
parent_decl_at_position 3.6±0.19ms 3.6±0.04ms 0.00%
prepare_rename 338.0±10.20µs 336.3±3.96µs -0.50%
rename 8.9±0.08ms 8.9±0.11ms 0.00%
semantic_tokens 1196.5±43.26µs 1271.0±10.36µs +6.23%
token_at_position 335.8±2.84µs 339.9±2.12µs +1.22%
tokens_at_position 3.5±0.04ms 3.5±0.03ms 0.00%
tokens_for_file 393.6±2.68µs 400.2±2.92µs +1.68%
traverse 36.0±0.67ms 36.1±0.69ms +0.28%

Copy link

Benchmark for 8e33560

Click to view benchmark
Test Base PR %
code_action 5.0±0.08ms 5.1±0.11ms +2.00%
code_lens 304.8±6.97ns 289.1±10.40ns -5.15%
compile 3.4±0.09s 3.5±0.09s +2.94%
completion 4.6±0.03ms 4.6±0.08ms 0.00%
did_change_with_caching 3.2±0.05s 3.2±0.07s 0.00%
document_symbol 937.1±23.19µs 868.2±25.40µs -7.35%
format 87.8±0.71ms 87.3±0.93ms -0.57%
goto_definition 345.7±10.48µs 348.5±4.81µs +0.81%
highlight 8.6±0.13ms 8.8±0.19ms +2.33%
hover 570.3±6.81µs 569.9±7.05µs -0.07%
idents_at_position 119.1±0.35µs 119.3±1.33µs +0.17%
inlay_hints 636.9±11.06µs 631.9±11.91µs -0.79%
on_enter 463.3±13.40ns 460.0±7.18ns -0.71%
parent_decl_at_position 3.5±0.03ms 3.5±0.07ms 0.00%
prepare_rename 342.5±8.20µs 349.6±8.14µs +2.07%
rename 8.9±0.18ms 9.0±0.14ms +1.12%
semantic_tokens 1287.6±12.13µs 1284.0±12.79µs -0.28%
token_at_position 336.2±3.38µs 332.8±3.45µs -1.01%
tokens_at_position 3.5±0.03ms 3.6±0.29ms +2.86%
tokens_for_file 394.6±2.69µs 396.8±2.62µs +0.56%
traverse 36.4±0.96ms 36.6±1.33ms +0.55%

Copy link

Benchmark for 3228c41

Click to view benchmark
Test Base PR %
code_action 5.2±0.49ms 5.1±0.10ms -1.92%
code_lens 303.0±8.01ns 291.4±11.49ns -3.83%
compile 3.4±0.06s 3.5±0.09s +2.94%
completion 4.6±0.04ms 4.6±0.08ms 0.00%
did_change_with_caching 3.2±0.06s 3.2±0.07s 0.00%
document_symbol 910.6±47.20µs 930.3±33.04µs +2.16%
format 88.1±1.55ms 87.2±1.04ms -1.02%
goto_definition 340.9±6.85µs 351.1±6.04µs +2.99%
highlight 8.8±0.23ms 8.7±0.21ms -1.14%
hover 574.5±9.28µs 587.3±19.48µs +2.23%
idents_at_position 120.6±0.29µs 119.0±0.75µs -1.33%
inlay_hints 631.1±23.42µs 665.7±27.87µs +5.48%
on_enter 473.0±15.25ns 479.3±14.22ns +1.33%
parent_decl_at_position 3.6±0.26ms 3.6±0.08ms 0.00%
prepare_rename 346.7±21.37µs 347.9±6.55µs +0.35%
rename 9.1±0.75ms 9.0±0.03ms -1.10%
semantic_tokens 1267.3±19.76µs 1311.2±16.71µs +3.46%
token_at_position 336.4±7.03µs 343.3±2.60µs +2.05%
tokens_at_position 3.6±0.22ms 3.5±0.04ms -2.78%
tokens_for_file 431.0±8.75µs 400.5±2.10µs -7.08%
traverse 37.6±1.07ms 37.4±1.06ms -0.53%

@xunilrj xunilrj changed the title Fix std::Bytes buffer ownership Fix Bytes, Vec and String buffer ownership Jun 25, 2024
Copy link

Benchmark for c593846

Click to view benchmark
Test Base PR %
code_action 5.1±0.23ms 5.1±0.22ms 0.00%
code_lens 308.8±7.51ns 292.6±9.09ns -5.25%
compile 3.5±0.10s 3.6±0.08s +2.86%
completion 4.7±0.30ms 4.8±0.27ms +2.13%
did_change_with_caching 3.3±0.06s 3.4±0.09s +3.03%
document_symbol 926.9±40.55µs 900.7±48.68µs -2.83%
format 87.8±1.53ms 88.5±1.11ms +0.80%
goto_definition 338.7±5.86µs 339.9±10.42µs +0.35%
highlight 8.8±0.29ms 8.7±0.18ms -1.14%
hover 561.5±10.07µs 564.4±6.02µs +0.52%
idents_at_position 117.9±0.39µs 119.6±0.38µs +1.44%
inlay_hints 624.2±20.64µs 633.2±22.34µs +1.44%
on_enter 469.5±13.45ns 464.9±30.33ns -0.98%
parent_decl_at_position 3.6±0.07ms 3.6±0.07ms 0.00%
prepare_rename 336.2±9.64µs 336.0±6.53µs -0.06%
rename 9.2±0.38ms 9.1±0.24ms -1.09%
semantic_tokens 1267.1±11.62µs 1293.4±30.11µs +2.08%
token_at_position 338.0±4.36µs 335.1±2.30µs -0.86%
tokens_at_position 3.6±0.06ms 3.6±0.07ms 0.00%
tokens_for_file 398.2±2.45µs 397.3±2.58µs -0.23%
traverse 38.2±0.81ms 38.1±0.88ms -0.26%

@xunilrj xunilrj marked this pull request as ready for review June 25, 2024 12:50
@xunilrj xunilrj requested review from a team as code owners June 25, 2024 12:50
@xunilrj xunilrj force-pushed the xunilrj/make-bytes-own-buffer branch from 8512164 to afe8bdd Compare June 27, 2024 12:55
Copy link

Benchmark for 85b15ce

Click to view benchmark
Test Base PR %
code_action 5.2±0.01ms 5.0±0.01ms -3.85%
code_lens 291.1±9.46ns 284.5±7.05ns -2.27%
compile 2.5±0.02s 2.5±0.01s 0.00%
completion 4.7±0.07ms 4.5±0.06ms -4.26%
did_change_with_caching 2.4±0.03s 2.5±0.02s +4.17%
document_symbol 924.0±30.59µs 912.9±47.75µs -1.20%
format 81.9±1.02ms 81.5±0.73ms -0.49%
goto_definition 334.9±5.22µs 341.8±3.81µs +2.06%
highlight 9.0±0.09ms 8.6±0.12ms -4.44%
hover 482.0±5.27µs 489.1±5.10µs +1.47%
idents_at_position 121.1±0.55µs 120.8±0.74µs -0.25%
inlay_hints 634.4±19.32µs 626.5±23.02µs -1.25%
on_enter 462.2±7.60ns 458.1±15.53ns -0.89%
parent_decl_at_position 3.7±0.03ms 3.6±0.24ms -2.70%
prepare_rename 336.6±6.18µs 338.2±4.58µs +0.48%
rename 9.3±0.12ms 8.9±0.12ms -4.30%
semantic_tokens 1263.5±16.03µs 1293.2±17.58µs +2.35%
token_at_position 327.0±2.10µs 331.1±3.40µs +1.25%
tokens_at_position 3.7±0.01ms 3.6±0.04ms -2.70%
tokens_for_file 395.1±1.97µs 406.3±2.89µs +2.83%
traverse 37.5±0.66ms 38.1±0.88ms +1.60%

@xunilrj xunilrj force-pushed the xunilrj/make-bytes-own-buffer branch from afe8bdd to 79d17bb Compare June 27, 2024 16:09
Copy link

Benchmark for 6c51ec1

Click to view benchmark
Test Base PR %
code_action 5.0±0.01ms 5.3±0.09ms +6.00%
code_lens 280.1±10.49ns 283.2±5.47ns +1.11%
compile 2.6±0.03s 2.5±0.03s -3.85%
completion 4.5±0.01ms 4.7±0.03ms +4.44%
did_change_with_caching 2.5±0.02s 2.5±0.03s 0.00%
document_symbol 941.0±31.90µs 874.3±20.89µs -7.09%
format 74.0±0.66ms 73.4±1.14ms -0.81%
goto_definition 341.2±7.04µs 343.5±5.47µs +0.67%
highlight 8.7±0.20ms 9.2±0.84ms +5.75%
hover 495.4±6.02µs 493.5±4.79µs -0.38%
idents_at_position 118.4±0.72µs 118.6±0.39µs +0.17%
inlay_hints 638.6±6.84µs 648.3±13.38µs +1.52%
on_enter 466.2±13.37ns 487.8±26.79ns +4.63%
parent_decl_at_position 3.6±0.05ms 3.7±0.03ms +2.78%
prepare_rename 339.4±3.95µs 344.5±11.03µs +1.50%
rename 8.9±0.15ms 9.3±0.02ms +4.49%
semantic_tokens 1291.5±14.75µs 1318.3±13.18µs +2.08%
token_at_position 342.8±6.27µs 339.9±4.42µs -0.85%
tokens_at_position 3.6±0.08ms 3.7±0.04ms +2.78%
tokens_for_file 398.4±1.82µs 406.8±1.64µs +2.11%
traverse 38.3±0.76ms 37.7±1.39ms -1.57%

@xunilrj xunilrj force-pushed the xunilrj/make-bytes-own-buffer branch from 79d17bb to 1856980 Compare June 28, 2024 14:35
Copy link

Benchmark for c44da0a

Click to view benchmark
Test Base PR %
code_action 5.0±0.08ms 5.2±0.09ms +4.00%
code_lens 279.0±6.09ns 283.2±10.68ns +1.51%
compile 2.5±0.03s 2.5±0.02s 0.00%
completion 4.5±0.10ms 4.7±0.06ms +4.44%
did_change_with_caching 2.4±0.02s 2.5±0.03s +4.17%
document_symbol 924.0±39.57µs 926.7±30.05µs +0.29%
format 78.8±1.99ms 73.4±0.89ms -6.85%
goto_definition 407.9±5.43µs 337.9±9.32µs -17.16%
highlight 8.7±0.17ms 9.0±0.10ms +3.45%
hover 486.9±4.92µs 486.5±5.39µs -0.08%
idents_at_position 119.6±1.08µs 121.1±0.29µs +1.25%
inlay_hints 621.5±27.11µs 641.2±18.35µs +3.17%
on_enter 465.0±8.06ns 478.9±14.82ns +2.99%
parent_decl_at_position 3.5±0.03ms 3.7±0.03ms +5.71%
prepare_rename 336.2±14.09µs 341.4±6.08µs +1.55%
rename 8.8±0.01ms 9.3±0.15ms +5.68%
semantic_tokens 1261.3±8.01µs 1245.7±12.15µs -1.24%
token_at_position 340.3±4.20µs 337.8±1.74µs -0.73%
tokens_at_position 3.5±0.05ms 3.7±0.04ms +5.71%
tokens_for_file 398.6±3.20µs 402.3±6.10µs +0.93%
traverse 37.6±0.98ms 37.9±1.62ms +0.80%

@IGI-111 IGI-111 added the breaking May cause existing user code to break. Requires a minor or major release. label Jul 1, 2024
IGI-111
IGI-111 previously approved these changes Jul 1, 2024
@IGI-111 IGI-111 requested a review from a team July 1, 2024 13:09
Copy link

github-actions bot commented Jul 1, 2024

Benchmark for 040c3a6

Click to view benchmark
Test Base PR %
code_action 5.2±0.03ms 5.3±0.24ms +1.92%
code_lens 285.0±12.90ns 282.9±9.71ns -0.74%
compile 2.6±0.02s 2.6±0.04s 0.00%
completion 4.7±0.02ms 4.7±0.06ms 0.00%
did_change_with_caching 2.4±0.02s 2.5±0.03s +4.17%
document_symbol 925.9±45.12µs 918.4±44.07µs -0.81%
format 73.5±1.08ms 74.9±0.92ms +1.90%
goto_definition 341.2±6.84µs 346.3±6.13µs +1.49%
highlight 9.1±0.11ms 9.2±0.03ms +1.10%
hover 489.3±4.88µs 500.5±5.89µs +2.29%
idents_at_position 118.5±1.49µs 119.1±1.54µs +0.51%
inlay_hints 644.6±8.32µs 648.4±15.89µs +0.59%
on_enter 469.2±10.29ns 477.8±12.69ns +1.83%
parent_decl_at_position 3.7±0.05ms 3.7±0.04ms 0.00%
prepare_rename 334.2±3.52µs 345.4±6.84µs +3.35%
rename 9.4±0.52ms 9.5±0.04ms +1.06%
semantic_tokens 1293.8±14.95µs 1294.0±63.86µs +0.02%
token_at_position 344.9±9.90µs 333.1±1.79µs -3.42%
tokens_at_position 3.7±0.03ms 3.7±0.08ms 0.00%
tokens_for_file 396.0±4.54µs 400.1±5.86µs +1.04%
traverse 36.8±0.57ms 38.3±1.11ms +4.08%

@xunilrj xunilrj force-pushed the xunilrj/make-bytes-own-buffer branch from fcb18c9 to f9372bd Compare July 2, 2024 06:36
@xunilrj xunilrj dismissed stale reviews from jjcnn and JoshuaBatty via d51cb05 July 8, 2024 16:12
@xunilrj xunilrj force-pushed the xunilrj/make-bytes-own-buffer branch from 02e1c09 to d51cb05 Compare July 8, 2024 16:12
Copy link

github-actions bot commented Jul 8, 2024

Benchmark for 172fa09

Click to view benchmark
Test Base PR %
code_action 5.2±0.02ms 5.0±0.14ms -3.85%
code_lens 288.9±10.53ns 317.0±14.03ns +9.73%
compile 2.6±0.03s 2.6±0.04s 0.00%
completion 4.7±0.06ms 4.5±0.09ms -4.26%
did_change_with_caching 2.5±0.02s 2.6±0.03s +4.00%
document_symbol 851.1±25.98µs 844.8±24.89µs -0.74%
format 72.3±2.06ms 70.7±0.54ms -2.21%
goto_definition 339.9±4.64µs 336.9±6.16µs -0.88%
highlight 9.0±0.15ms 8.7±0.16ms -3.33%
hover 500.3±9.29µs 491.2±4.09µs -1.82%
idents_at_position 117.8±1.00µs 117.0±1.08µs -0.68%
inlay_hints 629.8±20.80µs 626.5±15.10µs -0.52%
on_enter 456.9±7.46ns 468.1±18.28ns +2.45%
parent_decl_at_position 3.7±0.03ms 3.6±0.03ms -2.70%
prepare_rename 332.6±7.75µs 336.3±4.97µs +1.11%
rename 9.3±0.05ms 9.0±0.16ms -3.23%
semantic_tokens 1278.7±17.23µs 1246.6±17.84µs -2.51%
token_at_position 333.3±3.37µs 337.9±2.39µs +1.38%
tokens_at_position 3.7±0.02ms 3.5±0.02ms -5.41%
tokens_for_file 400.7±6.88µs 404.0±7.13µs +0.82%
traverse 38.2±1.03ms 38.7±0.72ms +1.31%

@xunilrj xunilrj requested review from JoshuaBatty, IGI-111 and jjcnn July 8, 2024 19:51
@JoshuaBatty JoshuaBatty requested a review from a team July 8, 2024 23:22
@IGI-111 IGI-111 merged commit 090187e into master Jul 8, 2024
35 checks passed
@IGI-111 IGI-111 deleted the xunilrj/make-bytes-own-buffer branch July 8, 2024 23:55
Copy link

github-actions bot commented Jul 9, 2024

Benchmark for b913132

Click to view benchmark
Test Base PR %
code_action 5.3±0.13ms 5.5±0.11ms +3.77%
code_lens 289.9±10.96ns 286.8±11.15ns -1.07%
compile 2.7±0.04s 2.8±0.04s +3.70%
completion 4.9±0.20ms 5.0±0.21ms +2.04%
did_change_with_caching 2.6±0.05s 2.7±0.04s +3.85%
document_symbol 924.9±27.09µs 874.0±22.14µs -5.50%
format 71.7±1.01ms 73.2±1.19ms +2.09%
goto_definition 348.7±10.05µs 347.7±5.20µs -0.29%
highlight 9.1±0.07ms 9.3±0.21ms +2.20%
hover 502.6±7.16µs 501.2±5.62µs -0.28%
idents_at_position 118.6±0.60µs 119.2±0.41µs +0.51%
inlay_hints 648.8±22.66µs 639.4±28.58µs -1.45%
on_enter 465.5±14.30ns 470.7±13.30ns +1.12%
parent_decl_at_position 3.7±0.04ms 3.8±0.11ms +2.70%
prepare_rename 344.3±5.16µs 352.3±7.43µs +2.32%
rename 9.4±0.11ms 9.5±0.07ms +1.06%
semantic_tokens 1243.6±9.71µs 1309.2±29.71µs +5.28%
token_at_position 334.5±4.18µs 341.7±2.25µs +2.15%
tokens_at_position 3.8±0.13ms 3.8±0.16ms 0.00%
tokens_for_file 405.9±4.18µs 400.4±3.08µs -1.36%
traverse 37.8±0.74ms 39.5±1.10ms +4.50%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking May cause existing user code to break. Requires a minor or major release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants