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

Add TinyGo support for {DI,TO0,TO1}Server #4

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ben-krieger
Copy link
Member

@ben-krieger ben-krieger commented Oct 7, 2024

$ GOOS=js GOARCH=wasm go build -ldflags '-s -w' -o go-rv.wasm ./examples/wasm/main.go && du -h go-rv.wasm
8.7M    go-rv.wasm
$ tinygo build -target wasm -no-debug -o tinygo-rv.wasm ./examples/wasm/main.go && du -h tinygo-rv.wasm
1.3M    tinygo-rv.wasm

~80% size reduction before compression

http/util_tinygo.go Outdated Show resolved Hide resolved
Signed-off-by: Ben Krieger <ben.krieger@intel.com>
Signed-off-by: Ben Krieger <ben.krieger@intel.com>

import "reflect"

func mapClear(rv reflect.Value) { rv.Clear() }
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to try to get (reflect.Value).Clear upstreamed to tinygo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant