Comments (8)
I wouldn't say anything is up. Different languages include different amounts of the runtime in the final binary. Besides hand-written wasm, AssemblyScript will get you the tiniest binaries since the code you write is very similar to what gets emitted (it's not actually TypeScript, so there's no runtime it needs to ship other than malloc
and a light GC). It's a similar problem with Swift—they include the entire standard library in the binaries.
Rust is definitely a premier language for WebAssembly, but it wasn't necessarily designed with WebAssembly in mind. It's getting better over time though.
wasm-opt
is really smart, but there's a lot of situations that it can't understand how to optimize without some help from the compiler. I can go into a ton of detail on this :)
I can also say that a handful of languages don't need a wasm-opt pass (though it won't hurt). AssemblyScript and Grain, for example, already have wasm-opt
run on the wasm as a part of their compilation process.
from subo.
@samderlust are you still working on this?
@denopink Hi, sorry no, I'm not working on this one right now. I remembered back then I read some documents that mentioned wasm file size was optimized by default or something (Couldn't find it now). So I stopped working on this. sorry for not updating
from subo.
hi,, I'm working on this
from subo.
@samderlust are you still working on this?
from subo.
A quick experiment with wasm-opt
on one of our Rust Runnables from the Reactr repo got these results:
wasm-opt -o rust-get.O3.wasm -O3 rust-get.wasm
wasm-opt -o rust-get.Os.wasm -Os rust-get.wasm
-rw-r--r-- 1 jagger staff 1.5M 23 Nov 11:40 rust-get.O3.wasm
-rw-r--r-- 1 jagger staff 1.5M 23 Nov 11:40 rust-get.Os.wasm
-rw-r--r-- 1 jagger staff 1.8M 20 Nov 21:36 rust-get.wasm
Something is up with our Rust Runnables, because TinyGo spits out much smaller files for similar behaviour.
-rwxr-xr-x 1 jagger staff 57K 20 Nov 21:36 tinygo-cache.wasm
And AssemblyScript is smaller still:
-rw-r--r-- 1 jagger staff 6.8K 20 Nov 16:54 as-get.wasm
from subo.
@ospencer any ideas?
from subo.
@ospencer that makes sense. Since it doesn't hurt to run wasm-opt
, is there any downsides to running it as a default behavior for subo build [dir]
and then provide a flag to disable it subo build [dir] --no-opt
?
from subo.
We could maybe do something like that, yeah. The only thing I'm concerned about is when building with --native
, I don't want to require having wasm-opt
available on the host machine
from subo.
Related Issues (20)
- Subo should not dump `compute deploy --local` artifacts to `$(pwd)`
- Improve subo-generated SCN manifest
- Rename SCC -> SCN everywhere
- Clarify FQFN term when creating (first?) function
- Deployment wizard
- Remove version number from release artifact names
- Subo should support systems with docker compose (v2) HOT 8
- Editor proxy fails to bind to HTTP port on Linux
- Convert `create handler` into `create workflow`
- Add cargo check to rust tool chain
- Provide instructions for upgrading Subo
- Expand option selection instruction in the REPL HOT 1
- Error: 🚫 failed to ExecTmplDir: template missing HOT 1
- Remove Atmo mentions
- feat(Builder): Build for context api
- Remove `subo dev`
- Remove subo's references to `compute`
- techdebt: replace logger with rs/zerolog HOT 1
- subo create module --lang should be renamed to --template
- SE2 REPL should prompt for template selection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from subo.