create account

RE: Rust Web Assembly - Using Stdweb to Build a Client side Application with Rust and WASM by drsensor

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @tensor/rust-web-assembly-using-stdweb-to-build-a-client-side-application-with-rust-and-wasm

· @drsensor · (edited)
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. 
properties (22)
authordrsensor
permlinkre-tensor-rust-web-assembly-using-stdweb-to-build-a-client-side-application-with-rust-and-wasm-20180713t073108158z
categoryutopian-io
json_metadata{"community":"busy","app":"busy/2.5.2","format":"markdown","tags":["utopian-io"],"users":[],"links":[],"image":[]}
created2018-07-13 07:31:12
last_update2018-07-13 07:33:18
depth1
children2
last_payout2018-07-20 07:31:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length383
author_reputation17,679,210,755,117
root_title"Rust Web Assembly - Using Stdweb to Build a Client side Application with Rust and WASM"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id64,502,157
net_rshares0
@tensor · (edited)
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.
👍  
properties (23)
authortensor
permlinkre-drsensor-re-tensor-rust-web-assembly-using-stdweb-to-build-a-client-side-application-with-rust-and-wasm-20180713t074814699z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-07-13 07:48:12
last_update2018-07-13 07:50:42
depth2
children1
last_payout2018-07-20 07:48:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length804
author_reputation87,856,203,149,624
root_title"Rust Web Assembly - Using Stdweb to Build a Client side Application with Rust and WASM"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id64,503,497
net_rshares3,160,019,910
author_curate_reward""
vote details (1)
@drsensor · (edited)
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
properties (22)
authordrsensor
permlinkre-tensor-re-drsensor-re-tensor-rust-web-assembly-using-stdweb-to-build-a-client-side-application-with-rust-and-wasm-20180713t151002338z
categoryutopian-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":[]}
created2018-07-13 15:10:03
last_update2018-07-14 03:05:00
depth3
children0
last_payout2018-07-20 15:10:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length375
author_reputation17,679,210,755,117
root_title"Rust Web Assembly - Using Stdweb to Build a Client side Application with Rust and WASM"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id64,545,631
net_rshares0