-
Notifications
You must be signed in to change notification settings - Fork 22
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
build: investigate shrinking WASM blob size using tiny-go #33
Comments
runtime/trace package is incompatible. This breaks all the OpenTelemetry stuff |
stdlib compatibility list here: https://tinygo.org/docs/reference/lang-support/stdlib/ I've assessed all the dependencies in LNC directly, and pulled in through vendor issues with imports:archive/tar issues with tests:bufio |
Re OpenTelemetry, looks like it's just a dep brought in thru aperture:
In this case, it's only really required atm for the itests, so there might just need to add a build tag workaround. |
Not being able to import However, I wonder if it's possible for us to take a multi-pronged approach here. With this hypothetical path, we'd actually have multiple wasm files, with us trying to pack as much into the |
In terms of shrinking things after the fact, looks like we might be able to use this Here's a blog post that shows an example near the end: https://www.fermyon.com/blog/optimizing-tinygo-wasm#Reducing%20More%20with%20Wasm-opt |
I tried gzip'ing locally, and got a pretty nice size reduction:
|
Are there any updates on this? I think it would be great to make more optimizations for file size, the current WASM file is sitting at |
Was brought up in this twitter thread: https://twitter.com/roasbeef/status/1486422025816064000
TinyGo is an alternate Go compiler that is intended for embedded systems, and support compiling to a WASM target: https://tinygo.org/docs/reference/usage/subcommands/#build.
Their overview page demonstrators shrinking a binary size by 99% just by instead compiling using the Tiny Go compiler. Certain Go language features aren't fully supported, so we may need to add some additional build tag layers to make it possible. So far, someone has identified that we'll need to build tag out the
pprof
import at the very least.The text was updated successfully, but these errors were encountered: