Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

perf: reduce wasm release binary size#4547

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

sapphi-red
Copy link
Collaborator

Description

This PR reduces the wasm binary size by tweaking some build options. I guess these were not set to iterate the initial build setup, but we can set it now.

  • Original: 9.7MB
    • lto='thin' => lto=true: 8.3MB
    • codegen-units=16 => codegen-units=1: 7.9MB
    • debug='full' => debug=false: 7.9MB
    • strip='none' => strip='symbols': 7.9MB

Thedebug andstrip did not change the binary size. The output binary did not include debug information, so maybe it is stripped by napi-rs.

@CopilotCopilotAI review requested due to automatic review settingsMay 14, 2025 12:49
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR aims to reduce the size of the wasm release binary by tweaking Cargo build profile options.

  • Removed extra build options (codegen-units, debug, lto, strip) from the [profile.release-wasi] section.
  • Retained essential settings via inheritance from the "release" profile and set opt-level to "s".
Comments suppressed due to low confidence (1)

Cargo.toml:16

  • [nitpick] The [profile.release-wasi] block includes an 'inherits = "release"' line that appears redundant given the existing inheritance in the file. Consider removing one of the duplicate lines to simplify the configuration.
inherits = "release"

@sapphi-redsapphi-red added this pull request to themerge queueMay 14, 2025
Merged via the queue intorolldown:main with commitbf53a10May 14, 2025
31 checks passed
@sapphi-redsapphi-red deleted the perf/reduce-wasm-build-size branchMay 14, 2025 13:50
@Brooooooklyn
Copy link
Member

The debug and strip did not change the binary size. The output binary did not include debug information, so maybe it is stripped by napi-rs.

NAPI-RS will remove debug information and symbols, but before doing so, it will first generate a rolldown-debug.wasm32-wasi.wasm file. This is for future debugging purposes. For example, if a crash occurs on a user's machine, the correct error stack can be viewed simply by downloading and replacing the original wasm file with this one. We'll optimize this part of the process when we have more time in the future.

@sapphi-red
Copy link
CollaboratorAuthor

@Brooooooklyn Ah, I see. I'll put back them with a comment then 👍

github-merge-queuebot pushed a commit that referenced this pull requestMay 15, 2025
<!-- Thank you for contributing! -->### DescriptionContext:#4547 (comment)<!-- Please insert your description here and provide especially infoabout the "what" this PR is solving -->
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@IWANABETHATGUYIWANABETHATGUYIWANABETHATGUY approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@sapphi-red@Brooooooklyn@IWANABETHATGUY

[8]ページ先頭

©2009-2025 Movatter.jp