Viewing a response to: @tensor/rust-web-assembly-using-stdweb-to-build-a-client-side-application-with-rust-and-wasm
Curious how long it takes to compile when someone building full scale web site/app purely in Rust. Ah yes, have you measure the bundle size of JS file as a result of compile using wasm-bindgen and/or stdweb? I found many garbage when compiling without wasm-bindgen and stdweb (pure wasm, no js binding). Also found out the bundle size can be reduced significantly when enabling LTO.
author | drsensor |
---|---|
permlink | re-tensor-rust-web-assembly-using-stdweb-to-build-a-client-side-application-with-rust-and-wasm-20180713t073108158z |
category | utopian-io |
json_metadata | {"community":"busy","app":"busy/2.5.2","format":"markdown","tags":["utopian-io"],"users":[],"links":[],"image":[]} |
created | 2018-07-13 07:31:12 |
last_update | 2018-07-13 07:33:18 |
depth | 1 |
children | 2 |
last_payout | 2018-07-20 07:31:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 383 |
author_reputation | 17,679,210,755,117 |
root_title | "Rust Web Assembly - Using Stdweb to Build a Client side Application with Rust and WASM" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 64,502,157 |
net_rshares | 0 |
There are quite a few tools that you can use to vastly reduce the bundle size with both libraries. In fact, you can just pull out most of the Rust functionality that you don't need and you can get it down to <100 kb with even very large projects. Of course this doesn't account for some of the more wasm specific tools which can reduce the size much further. Compilation timing in Rust is average id say when compared to other AoT based languages. Its not as fast as Go for instance, but it is much faster then Java. When I start to do some larger projects with WASM, I will start showing off some of the techniques and tools to optimize performance and bundle size of WASM projects built from Rust. I am also considering doing some computation benchmark tutorials but we will see about that one.
author | tensor |
---|---|
permlink | re-drsensor-re-tensor-rust-web-assembly-using-stdweb-to-build-a-client-side-application-with-rust-and-wasm-20180713t074814699z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"app":"steemit/0.1"} |
created | 2018-07-13 07:48:12 |
last_update | 2018-07-13 07:50:42 |
depth | 2 |
children | 1 |
last_payout | 2018-07-20 07:48:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 804 |
author_reputation | 87,856,203,149,624 |
root_title | "Rust Web Assembly - Using Stdweb to Build a Client side Application with Rust and WASM" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 64,503,497 |
net_rshares | 3,160,019,910 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
drsensor | 0 | 3,160,019,910 | 100% |
Nice! For the tools to reduce the bundle size, I have tried using [wasm-gc](https://github.com/alexcrichton/wasm-gc) and [Binaryen][]. The most intriguing (and the best) one is Binaryen that [I can't still figure out which configuration is the best for some use case](https://github.com/DrSensor/binaryen-loader/issues/2). [Binaryen]: https://github.com/WebAssembly/binaryen
author | drsensor |
---|---|
permlink | re-tensor-re-drsensor-re-tensor-rust-web-assembly-using-stdweb-to-build-a-client-side-application-with-rust-and-wasm-20180713t151002338z |
category | utopian-io |
json_metadata | {"community":"busy","app":"busy/2.5.2","format":"markdown","tags":["utopian-io"],"users":[],"links":["https://github.com/alexcrichton/wasm-gc","https://github.com/WebAssembly/binaryen","https://github.com/DrSensor/binaryen-loader/issues/2"],"image":[]} |
created | 2018-07-13 15:10:03 |
last_update | 2018-07-14 03:05:00 |
depth | 3 |
children | 0 |
last_payout | 2018-07-20 15:10:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 375 |
author_reputation | 17,679,210,755,117 |
root_title | "Rust Web Assembly - Using Stdweb to Build a Client side Application with Rust and WASM" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 64,545,631 |
net_rshares | 0 |