# Why Rust wasm binaries are bigger than Motoko

**URL:** <https://forum.dfinity.org/t/why-rust-wasm-binaries-are-bigger-than-motoko/19990>\
**Category:** Rust\
**Created:** [May 14, 2023, 10:57pm UTC](https://forum.dfinity.org/t/why-rust-wasm-binaries-are-bigger-than-motoko/19990 "2023-05-14T22:57:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robert.zaremba](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/robert.zaremba/32/8648_2.png) [@robert.zaremba](https://forum.dfinity.org/u/robert.zaremba)\
**Post date:** [May 14, 2023, 10:57pm UTC](https://forum.dfinity.org/t/why-rust-wasm-binaries-are-bigger-than-motoko/19990/1 "2023-05-14T22:57:34Z")

</div>

Why compiled Rust wasm binaries are 2-3 times bigger than Motoko ones?

One overview recently published: [Collection libraries | canister-profiling](https://dfinity.github.io/canister-profiling/collections)

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [May 15, 2023, 7:57am UTC](https://forum.dfinity.org/t/why-rust-wasm-binaries-are-bigger-than-motoko/19990/2 "2023-05-15T07:57:28Z")

</div>

Most likely because they are tailored for different purposes. Rust is a general-purpose language, while Motoko is custom-built for the IC. Rust projects have a lot more dependencies than Motoko projects, and all these layers cannot be optimised away all that easily

---

<div class="post-metadata">

**Author:** ![stopak](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/stopak/32/9896_2.png) [@stopak](https://forum.dfinity.org/u/stopak)\
**Post date:** [May 15, 2023, 8:24am UTC](https://forum.dfinity.org/t/why-rust-wasm-binaries-are-bigger-than-motoko/19990/3 "2023-05-15T08:24:52Z")

</div>

I did not find information about it, however with Rust containers you have several options to optimize the size. The difference can be significant in footprint.
