# Decrease Duniter build time

**URL:** https://forum.duniter.org/t/decrease-duniter-build-time/10170
**Category:** Duniter-v2s
**Created:** [14 December 2022 15:56 UTC](https://forum.duniter.org/t/decrease-duniter-build-time/10170 "2022-12-14T15:56:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![HugoTrentesaux](https://forum.duniter.org/user_avatar/forum.duniter.org/hugotrentesaux/32/6396_2.png) [@HugoTrentesaux](https://forum.duniter.org/u/HugoTrentesaux)
#### Post date: [14 December 2022 15:56 UTC](https://forum.duniter.org/t/decrease-duniter-build-time/10170/1 "2022-12-14T15:56:59Z")

</div>

@tuxmain could you share the way you decreased Duniter build time?

---

<div class="post-metadata">

### Author: ![tuxmain](https://forum.duniter.org/user_avatar/forum.duniter.org/tuxmain/32/6423_2.png) [@tuxmain](https://forum.duniter.org/u/tuxmain)
#### Post date: [14 December 2022 17:46 UTC](https://forum.duniter.org/t/decrease-duniter-build-time/10170/2 "2022-12-14T17:46:05Z")

</div>

The GNU linker ld is not parallelized, so you can observe that at the very end of the compilation, cargo spends a lot of time using only one core. One way to speed up linking is to use mold instead, which is parallelized and more efficient.

You can build it yourself, install a package or download a release from GitHub:

> **[GitHub - rui314/mold: mold: A Modern Linker 🦠](https://github.com/rui314/mold)**
>
> mold: A Modern Linker 🦠. Contribute to rui314/mold development by creating an account on GitHub.

(if you don’t have the package, move the binary to `/usr/bin/mold`)

Then add this to `~/.cargo/config`:

```auto
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=/usr/bin/mold"]

```

(change the target if needed) (you may need to install clang)

To save storage, I recommend to do `rm -r target` in your Rust project directories before rebuilding them with this new config.

Edit: This affects all the cargo builds to this target by the user, not only Duniter.

---

<div class="post-metadata">

### Author: ![HugoTrentesaux](https://forum.duniter.org/user_avatar/forum.duniter.org/hugotrentesaux/32/6396_2.png) [@HugoTrentesaux](https://forum.duniter.org/u/HugoTrentesaux)
#### Post date: [14 December 2022 18:45 UTC](https://forum.duniter.org/t/decrease-duniter-build-time/10170/3 "2022-12-14T18:45:08Z")

</div>

```auto
sudo pacman -S mold

```

Thanks a lot!

note to myself: add this to Duniter doc
