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: Print the formatted bytecode size on forc build #6214

Merged
merged 3 commits into from
Jul 4, 2024

Conversation

sdankel
Copy link
Member

@sdankel sdankel commented Jul 3, 2024

Description

Users can see the bytecode size for every compiled package using the --verbose flag with forc build.

The PR makes it so they see the total bytecode size by default without verbose mode in the Finished status message.

For workspaces, the bytecode size is the sum of all of the built packages' bytecode.

image

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

github-actions bot commented Jul 3, 2024

Benchmark for e3482b2

Click to view benchmark
Test Base PR %
code_action 5.1±0.08ms 5.2±0.13ms +1.96%
code_lens 277.9±4.76ns 330.1±9.32ns +18.78%
compile 2.5±0.03s 2.5±0.05s 0.00%
completion 4.5±0.01ms 4.7±0.14ms +4.44%
did_change_with_caching 2.5±0.02s 2.5±0.02s 0.00%
document_symbol 895.0±27.98µs 945.2±30.17µs +5.61%
format 81.6±1.22ms 70.7±1.42ms -13.36%
goto_definition 342.3±5.76µs 379.8±6.42µs +10.96%
highlight 8.7±0.01ms 9.0±0.03ms +3.45%
hover 493.2±5.34µs 558.5±4.98µs +13.24%
idents_at_position 116.8±2.16µs 119.8±0.89µs +2.57%
inlay_hints 620.5±35.92µs 637.5±21.11µs +2.74%
on_enter 460.6±6.13ns 466.8±12.70ns +1.35%
parent_decl_at_position 3.5±0.03ms 3.7±0.02ms +5.71%
prepare_rename 336.5±4.96µs 378.0±5.48µs +12.33%
rename 8.9±0.16ms 9.2±0.02ms +3.37%
semantic_tokens 1259.8±12.72µs 1276.9±14.17µs +1.36%
token_at_position 334.4±4.03µs 336.9±3.50µs +0.75%
tokens_at_position 3.5±0.02ms 3.7±0.04ms +5.71%
tokens_for_file 396.4±2.13µs 437.0±9.94µs +10.24%
traverse 36.6±0.53ms 37.6±0.72ms +2.73%

@sdankel sdankel marked this pull request as ready for review July 3, 2024 22:21
@sdankel sdankel requested review from a team as code owners July 3, 2024 22:21
@sdankel sdankel enabled auto-merge (squash) July 3, 2024 22:23
Copy link

github-actions bot commented Jul 3, 2024

Benchmark for 0c7ff0b

Click to view benchmark
Test Base PR %
code_action 5.1±0.20ms 5.2±0.05ms +1.96%
code_lens 293.2±19.64ns 289.5±8.54ns -1.26%
compile 2.6±0.05s 2.6±0.03s 0.00%
completion 4.5±0.08ms 4.8±0.28ms +6.67%
did_change_with_caching 2.5±0.03s 2.5±0.04s 0.00%
document_symbol 915.1±35.82µs 903.1±46.01µs -1.31%
format 70.7±0.92ms 72.1±1.29ms +1.98%
goto_definition 337.9±4.37µs 338.0±7.19µs +0.03%
highlight 8.8±0.12ms 9.0±0.13ms +2.27%
hover 499.7±25.85µs 495.2±7.37µs -0.90%
idents_at_position 119.2±0.50µs 122.6±0.60µs +2.85%
inlay_hints 616.0±8.63µs 651.6±14.52µs +5.78%
on_enter 492.4±12.19ns 470.9±6.83ns -4.37%
parent_decl_at_position 3.6±0.04ms 3.7±0.04ms +2.78%
prepare_rename 343.2±5.59µs 339.5±6.13µs -1.08%
rename 9.0±0.11ms 9.3±0.12ms +3.33%
semantic_tokens 1241.6±7.53µs 1288.5±13.10µs +3.78%
token_at_position 340.0±2.64µs 340.9±5.16µs +0.26%
tokens_at_position 3.6±0.07ms 3.7±0.01ms +2.78%
tokens_for_file 398.0±3.39µs 397.7±2.57µs -0.08%
traverse 37.5±1.05ms 36.9±1.09ms -1.60%

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.

Great, thanks!

@JoshuaBatty JoshuaBatty requested review from a team July 4, 2024 01:18
@sdankel sdankel merged commit b7918e5 into master Jul 4, 2024
39 checks passed
@sdankel sdankel deleted the sophie/bytecode-size-fmt branch July 4, 2024 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants