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: avoid importing net/http on wasm #449

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Aug 20, 2024

  1. fix: avoid importing net/http on wasm

    Using goweight: https://github.com/paralin/goweight
    
    GOOS=js GOARCH=wasm goweight | less
    
    Without this change:
    
      7.9 MB runtime
      6.6 MB net/http
      3.1 MB net
      3.0 MB crypto/tls
      2.0 MB reflect
      1.4 MB math/big
      1.3 MB crypto/x509
      935 kB os
      ...
    
    With this change:
    
      7.9 MB runtime
      3.1 MB net
      2.0 MB reflect
      935 kB os
      ...
    
    Slight modifications to avoid importing net/http reduce the binary size significantly.
    
    Signed-off-by: Christian Stewart <[email protected]>
    paralin committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    db89d1b View commit details
    Browse the repository at this point in the history