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

feat: add log type info collection for test entries to enable log decoding at forc-test #5678

Closed
wants to merge 11 commits into from

Conversation

kayagokalp
Copy link
Member

Description

Adds necessary capabilities to forc-pkg to collect types of logs used in a test. Type information is retrieved from the type engine, and collected for each test entry. This will later on be used for decoding the log receipts at forc-test.

@kayagokalp kayagokalp added enhancement New feature or request forc-test Everything related to the `forc-test` lib and `forc test` command. forc-pkg Everything related to the `forc-pkg` crate. labels Mar 2, 2024
@kayagokalp kayagokalp self-assigned this Mar 2, 2024
@kayagokalp kayagokalp requested a review from a team March 2, 2024 21:45
Copy link

github-actions bot commented Mar 2, 2024

Benchmark for 5ad8bc8

Click to view benchmark
Test Base PR %
code_action 5.1±0.11ms 5.1±0.02ms 0.00%
code_lens 294.8±7.24ns 287.9±8.61ns -2.34%
compile 2.9±0.04s 3.0±0.02s +3.45%
completion 4.7±0.06ms 4.8±0.20ms +2.13%
did_change_with_caching 2.8±0.03s 2.8±0.03s 0.00%
document_symbol 969.0±14.98µs 981.9±26.82µs +1.33%
format 74.0±0.79ms 73.4±1.03ms -0.81%
goto_definition 367.0±7.11µs 361.6±7.37µs -1.47%
highlight 9.0±0.80ms 8.8±0.14ms -2.22%
hover 531.3±6.01µs 530.6±9.25µs -0.13%
idents_at_position 122.8±0.40µs 122.1±0.66µs -0.57%
inlay_hints 654.9±26.83µs 658.3±30.98µs +0.52%
on_enter 477.4±10.22ns 487.5±10.63ns +2.12%
parent_decl_at_position 3.6±0.04ms 3.6±0.04ms 0.00%
prepare_rename 362.2±7.12µs 361.1±5.92µs -0.30%
rename 9.2±0.15ms 9.1±0.06ms -1.09%
semantic_tokens 1063.8±18.70µs 1071.3±16.57µs +0.71%
token_at_position 358.9±2.55µs 354.7±3.38µs -1.17%
tokens_at_position 3.6±0.02ms 3.6±0.07ms 0.00%
tokens_for_file 415.3±2.68µs 419.5±11.52µs +1.01%
traverse 38.1±0.67ms 37.1±1.33ms -2.62%

Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Just a few nits.

forc-pkg/src/pkg.rs Outdated Show resolved Hide resolved
forc-pkg/src/pkg.rs Outdated Show resolved Hide resolved
forc-pkg/src/pkg.rs Outdated Show resolved Hide resolved
forc-pkg/src/pkg.rs Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Mar 3, 2024

Benchmark for 3fccf68

Click to view benchmark
Test Base PR %
code_action 5.3±0.09ms 5.2±0.12ms -1.89%
code_lens 322.1±13.29ns 326.8±5.42ns +1.46%
compile 3.0±0.02s 3.0±0.03s 0.00%
completion 4.7±0.03ms 4.7±0.05ms 0.00%
did_change_with_caching 2.8±0.03s 2.8±0.02s 0.00%
document_symbol 969.6±34.25µs 1033.3±25.78µs +6.57%
format 73.5±1.03ms 73.7±1.43ms +0.27%
goto_definition 359.8±9.05µs 370.3±8.06µs +2.92%
highlight 9.1±0.26ms 8.9±0.10ms -2.20%
hover 530.0±7.14µs 546.7±11.13µs +3.15%
idents_at_position 121.8±0.37µs 120.6±0.82µs -0.99%
inlay_hints 652.9±32.36µs 663.6±32.20µs +1.64%
on_enter 497.8±13.35ns 491.9±13.31ns -1.19%
parent_decl_at_position 3.6±0.03ms 3.6±0.06ms 0.00%
prepare_rename 358.4±9.45µs 368.5±5.95µs +2.82%
rename 9.1±0.21ms 9.3±0.20ms +2.20%
semantic_tokens 1035.9±41.36µs 1047.8±19.76µs +1.15%
token_at_position 355.8±2.88µs 363.6±2.78µs +2.19%
tokens_at_position 3.6±0.04ms 3.6±0.03ms 0.00%
tokens_for_file 423.4±3.39µs 411.7±3.06µs -2.76%
traverse 39.3±1.49ms 39.2±1.01ms -0.25%

@kayagokalp kayagokalp force-pushed the kayagokalp/log-decoding branch from ada8f0f to 90d31eb Compare March 5, 2024 23:53
Copy link

github-actions bot commented Mar 6, 2024

Benchmark for e502aeb

Click to view benchmark
Test Base PR %
code_action 5.3±0.13ms 5.3±0.13ms 0.00%
code_lens 284.9±4.78ns 290.0±7.23ns +1.79%
compile 4.2±0.12s 4.2±0.13s 0.00%
completion 4.8±0.10ms 4.8±0.01ms 0.00%
did_change_with_caching 3.7±0.09s 3.7±0.06s 0.00%
document_symbol 992.2±45.01µs 1034.1±22.20µs +4.22%
format 73.2±1.72ms 73.1±1.53ms -0.14%
goto_definition 361.0±5.93µs 356.9±6.89µs -1.14%
highlight 9.1±0.19ms 9.0±0.05ms -1.10%
hover 532.7±8.67µs 527.3±7.19µs -1.01%
idents_at_position 123.4±0.47µs 122.5±1.41µs -0.73%
inlay_hints 652.2±11.49µs 659.2±30.74µs +1.07%
on_enter 479.8±11.76ns 494.2±15.41ns +3.00%
parent_decl_at_position 3.7±0.04ms 3.7±0.05ms 0.00%
prepare_rename 353.1±6.18µs 370.4±6.19µs +4.90%
rename 9.4±0.15ms 9.4±0.05ms 0.00%
semantic_tokens 1044.5±15.27µs 1047.0±30.92µs +0.24%
token_at_position 354.5±1.81µs 357.2±2.19µs +0.76%
tokens_at_position 3.7±0.04ms 3.7±0.04ms 0.00%
tokens_for_file 414.9±3.49µs 450.2±1.55µs +8.51%
traverse 37.1±1.36ms 37.3±1.04ms +0.54%

Copy link

github-actions bot commented Mar 6, 2024

Benchmark for fcc2e69

Click to view benchmark
Test Base PR %
code_action 5.3±0.14ms 5.3±0.17ms 0.00%
code_lens 287.2±11.14ns 295.8±8.50ns +2.99%
compile 4.4±0.12s 4.3±0.11s -2.27%
completion 4.9±0.06ms 4.9±0.13ms 0.00%
did_change_with_caching 3.9±0.11s 3.9±0.17s 0.00%
document_symbol 961.8±16.76µs 1020.6±33.30µs +6.11%
format 72.9±0.72ms 74.7±0.75ms +2.47%
goto_definition 361.9±6.28µs 367.6±7.54µs +1.58%
highlight 9.0±0.18ms 9.2±0.21ms +2.22%
hover 533.4±9.09µs 542.3±8.67µs +1.67%
idents_at_position 122.9±0.42µs 122.2±0.96µs -0.57%
inlay_hints 660.2±30.04µs 671.0±34.57µs +1.64%
on_enter 479.9±10.90ns 492.4±14.30ns +2.60%
parent_decl_at_position 3.7±0.11ms 3.7±0.03ms 0.00%
prepare_rename 359.1±5.82µs 369.8±12.56µs +2.98%
rename 9.7±0.33ms 9.9±0.30ms +2.06%
semantic_tokens 1027.2±13.41µs 1057.0±15.95µs +2.90%
token_at_position 355.9±6.49µs 363.7±2.70µs +2.19%
tokens_at_position 3.7±0.08ms 3.7±0.16ms 0.00%
tokens_for_file 424.9±3.39µs 411.4±3.25µs -3.18%
traverse 37.6±0.83ms 38.0±1.22ms +1.06%

@kayagokalp kayagokalp requested review from sdankel and a team March 6, 2024 02:02
Copy link

github-actions bot commented Mar 6, 2024

Benchmark for e08123d

Click to view benchmark
Test Base PR %
code_action 5.3±0.18ms 5.3±0.04ms 0.00%
code_lens 288.9±12.89ns 295.7±8.32ns +2.35%
compile 4.2±0.09s 4.3±0.11s +2.38%
completion 4.9±0.26ms 4.9±0.11ms 0.00%
did_change_with_caching 3.8±0.12s 3.8±0.12s 0.00%
document_symbol 988.1±22.48µs 947.9±10.49µs -4.07%
format 73.6±0.84ms 73.3±1.10ms -0.41%
goto_definition 358.8±8.70µs 364.4±14.17µs +1.56%
highlight 9.0±0.04ms 9.1±0.18ms +1.11%
hover 532.4±6.60µs 535.1±8.19µs +0.51%
idents_at_position 122.0±0.30µs 121.5±0.41µs -0.41%
inlay_hints 647.5±9.09µs 660.0±11.92µs +1.93%
on_enter 474.4±7.41ns 485.3±10.56ns +2.30%
parent_decl_at_position 3.7±0.02ms 3.7±0.23ms 0.00%
prepare_rename 353.9±6.70µs 362.9±6.23µs +2.54%
rename 9.5±0.42ms 9.4±0.17ms -1.05%
semantic_tokens 1029.9±20.87µs 1073.9±22.48µs +4.27%
token_at_position 349.6±2.53µs 362.0±2.61µs +3.55%
tokens_at_position 3.7±0.04ms 3.7±0.02ms 0.00%
tokens_for_file 416.6±3.11µs 411.0±3.75µs -1.34%
traverse 37.6±1.68ms 37.7±0.82ms +0.27%

Copy link
Member

@sdankel sdankel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! 💯

Copy link

github-actions bot commented Mar 7, 2024

Benchmark for 3ea7c87

Click to view benchmark
Test Base PR %
code_action 5.4±0.07ms 5.4±0.01ms 0.00%
code_lens 287.6±3.28ns 353.9±10.97ns +23.05%
compile 5.9±0.08s 5.8±0.07s -1.69%
completion 4.9±0.03ms 4.9±0.02ms 0.00%
did_change_with_caching 5.3±0.09s 5.2±0.09s -1.89%
document_symbol 1028.2±34.51µs 1025.7±50.42µs -0.24%
format 70.5±0.97ms 70.4±0.76ms -0.14%
goto_definition 362.9±3.21µs 378.1±5.91µs +4.19%
highlight 9.1±0.18ms 9.1±0.02ms 0.00%
hover 590.2±20.42µs 600.6±20.24µs +1.76%
idents_at_position 123.3±0.36µs 124.1±0.90µs +0.65%
inlay_hints 665.6±18.80µs 692.5±44.77µs +4.04%
on_enter 487.2±12.69ns 486.5±12.26ns -0.14%
parent_decl_at_position 3.7±0.02ms 3.7±0.04ms 0.00%
prepare_rename 361.1±3.24µs 379.9±8.56µs +5.21%
rename 9.5±0.05ms 9.6±0.24ms +1.05%
semantic_tokens 1019.2±12.19µs 1046.5±11.00µs +2.68%
token_at_position 362.3±6.74µs 372.8±3.40µs +2.90%
tokens_at_position 3.7±0.03ms 3.7±0.02ms 0.00%
tokens_for_file 413.7±3.10µs 422.3±1.77µs +2.08%
traverse 45.5±2.45ms 43.0±1.23ms -5.49%

Copy link
Member

@JoshuaBatty JoshuaBatty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

github-actions bot commented Mar 8, 2024

Benchmark for cc22fc1

Click to view benchmark
Test Base PR %
code_action 5.4±0.07ms 5.4±0.03ms 0.00%
code_lens 290.0±8.00ns 290.6±7.71ns +0.21%
compile 6.1±0.10s 6.1±0.20s 0.00%
completion 5.0±0.14ms 4.9±0.08ms -2.00%
did_change_with_caching 5.4±0.05s 5.5±0.08s +1.85%
document_symbol 1005.6±47.62µs 1004.5±48.16µs -0.11%
format 71.2±0.92ms 70.6±0.65ms -0.84%
goto_definition 363.0±3.73µs 370.2±9.20µs +1.98%
highlight 9.2±0.28ms 9.1±0.20ms -1.09%
hover 581.5±10.01µs 582.7±16.93µs +0.21%
idents_at_position 123.4±0.65µs 123.5±1.47µs +0.08%
inlay_hints 672.9±23.62µs 668.5±5.33µs -0.65%
on_enter 495.8±11.71ns 511.7±15.90ns +3.21%
parent_decl_at_position 3.8±0.05ms 3.8±0.04ms 0.00%
prepare_rename 364.7±8.61µs 372.0±6.92µs +2.00%
rename 9.8±0.81ms 9.5±0.06ms -3.06%
semantic_tokens 1026.9±30.56µs 1039.5±21.02µs +1.23%
token_at_position 358.5±2.06µs 362.1±2.64µs +1.00%
tokens_at_position 3.8±0.02ms 3.8±0.09ms 0.00%
tokens_for_file 421.0±2.32µs 423.2±4.91µs +0.52%
traverse 46.7±1.89ms 45.1±1.63ms -3.43%

Copy link

Benchmark for 1f82760

Click to view benchmark
Test Base PR %
code_action 5.4±0.19ms 5.4±0.36ms 0.00%
code_lens 294.1±13.17ns 331.6±9.37ns +12.75%
compile 6.6±0.07s 6.2±0.07s -6.06%
completion 4.9±0.15ms 4.8±0.09ms -2.04%
did_change_with_caching 6.1±0.05s 5.7±0.05s -6.56%
document_symbol 950.4±42.96µs 984.4±23.34µs +3.58%
format 69.7±1.89ms 69.4±1.04ms -0.43%
goto_definition 361.9±5.64µs 363.7±8.41µs +0.50%
highlight 8.9±0.32ms 8.8±0.20ms -1.12%
hover 659.0±19.71µs 597.2±21.30µs -9.38%
idents_at_position 122.1±0.31µs 121.8±0.90µs -0.25%
inlay_hints 667.2±22.93µs 660.8±30.77µs -0.96%
on_enter 493.2±13.81ns 509.1±15.80ns +3.22%
parent_decl_at_position 3.6±0.03ms 3.6±0.12ms 0.00%
prepare_rename 357.5±8.34µs 364.4±5.51µs +1.93%
rename 9.4±0.17ms 9.2±0.26ms -2.13%
semantic_tokens 1043.1±35.26µs 1032.4±18.85µs -1.03%
token_at_position 354.5±1.74µs 358.6±1.77µs +1.16%
tokens_at_position 3.6±0.01ms 3.6±0.03ms 0.00%
tokens_for_file 435.7±1.57µs 411.0±3.84µs -5.67%
traverse 47.2±2.45ms 46.4±1.90ms -1.69%

Copy link

Benchmark for 6a1653e

Click to view benchmark
Test Base PR %
code_action 5.3±0.45ms 5.3±0.09ms 0.00%
code_lens 295.8±8.04ns 330.6±7.33ns +11.76%
compile 6.3±0.19s 6.1±0.11s -3.17%
completion 4.8±0.02ms 4.8±0.07ms 0.00%
did_change_with_caching 5.8±0.11s 5.6±0.04s -3.45%
document_symbol 942.2±6.36µs 1034.4±14.85µs +9.79%
format 70.1±3.13ms 72.4±1.16ms +3.28%
goto_definition 430.8±6.44µs 366.6±10.82µs -14.90%
highlight 8.7±0.20ms 8.8±0.14ms +1.15%
hover 636.1±17.45µs 647.6±25.88µs +1.81%
idents_at_position 122.3±0.96µs 122.4±1.21µs +0.08%
inlay_hints 644.7±29.36µs 652.7±15.00µs +1.24%
on_enter 484.6±14.02ns 496.1±18.63ns +2.37%
parent_decl_at_position 3.6±0.09ms 3.6±0.07ms 0.00%
prepare_rename 351.8±5.57µs 361.8±4.86µs +2.84%
rename 9.2±0.18ms 9.3±0.81ms +1.09%
semantic_tokens 1034.0±10.04µs 1054.7±11.09µs +2.00%
token_at_position 348.3±2.73µs 349.7±1.86µs +0.40%
tokens_at_position 3.6±0.02ms 3.6±0.07ms 0.00%
tokens_for_file 407.3±2.73µs 411.4±3.74µs +1.01%
traverse 44.9±1.70ms 45.3±1.48ms +0.89%

Copy link

Benchmark for f9a0a37

Click to view benchmark
Test Base PR %
code_action 5.6±0.40ms 5.5±0.17ms -1.79%
code_lens 296.6±4.16ns 292.1±9.79ns -1.52%
compile 3.2±0.03s 3.1±0.09s -3.13%
completion 4.8±0.16ms 4.9±0.27ms +2.08%
did_change_with_caching 3.0±0.05s 3.0±0.06s 0.00%
document_symbol 1026.3±37.82µs 986.5±76.30µs -3.88%
format 72.5±2.21ms 71.7±0.63ms -1.10%
goto_definition 364.6±5.82µs 370.3±9.01µs +1.56%
highlight 9.2±0.21ms 9.1±0.22ms -1.09%
hover 483.5±8.48µs 492.3±6.63µs +1.82%
idents_at_position 122.3±1.10µs 122.7±0.55µs +0.33%
inlay_hints 654.5±17.29µs 669.2±22.48µs +2.25%
on_enter 504.8±16.46ns 494.7±15.85ns -2.00%
parent_decl_at_position 3.7±0.05ms 3.7±0.04ms 0.00%
prepare_rename 362.0±6.84µs 370.7±5.68µs +2.40%
rename 10.1±1.13ms 9.9±0.26ms -1.98%
semantic_tokens 1099.2±52.67µs 1076.8±17.16µs -2.04%
token_at_position 356.0±6.22µs 367.9±2.30µs +3.34%
tokens_at_position 3.7±0.06ms 3.7±0.04ms 0.00%
tokens_for_file 421.1±3.01µs 424.4±4.51µs +0.78%
traverse 42.6±1.25ms 42.7±0.97ms +0.23%

Copy link

Benchmark for 3c64401

Click to view benchmark
Test Base PR %
code_action 5.4±0.11ms 5.4±0.05ms 0.00%
code_lens 295.6±5.69ns 296.2±11.66ns +0.20%
compile 3.0±0.03s 3.0±0.04s 0.00%
completion 4.7±0.09ms 4.7±0.09ms 0.00%
did_change_with_caching 2.9±0.03s 2.9±0.04s 0.00%
document_symbol 940.9±22.39µs 1003.4±39.71µs +6.64%
format 71.7±0.81ms 71.9±0.64ms +0.28%
goto_definition 364.6±6.11µs 372.9±4.54µs +2.28%
highlight 9.0±0.12ms 9.0±0.17ms 0.00%
hover 484.1±7.93µs 488.2±5.38µs +0.85%
idents_at_position 122.9±1.04µs 122.5±0.68µs -0.33%
inlay_hints 658.0±25.26µs 674.9±24.11µs +2.57%
on_enter 507.3±13.91ns 492.6±13.29ns -2.90%
parent_decl_at_position 3.7±0.03ms 3.7±0.06ms 0.00%
prepare_rename 360.5±5.39µs 370.2±5.49µs +2.69%
rename 9.6±0.13ms 9.6±0.19ms 0.00%
semantic_tokens 1043.0±48.66µs 1052.8±8.19µs +0.94%
token_at_position 358.5±8.23µs 366.1±5.30µs +2.12%
tokens_at_position 3.7±0.05ms 3.7±0.04ms 0.00%
tokens_for_file 417.9±1.69µs 421.2±2.21µs +0.79%
traverse 41.5±1.03ms 41.4±0.67ms -0.24%

@kayagokalp
Copy link
Member Author

closed in favor of #5812

@kayagokalp kayagokalp closed this May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forc-pkg Everything related to the `forc-pkg` crate. forc-test Everything related to the `forc-test` lib and `forc test` command.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants