LEARN_RUST_UKR Telegram 254
Сьогодні поговоримо про цікавий спосіб пришвидшити компіляцію Rust проекту у 1.5 – 2.5 разів 😁

На цей пост надихнув пост Інгвара у Bluesky ➡️ https://bsky.app/profile/rreverser.com/post/3lhtsq7revk2c

Трохи історії. У листопаді 2023 року робоча група Parallel Rustc (The Parallel Rustc Working Group) анонсували використання Cranelift як альтернативного бекенду компілятора для когодегенерації та можливості паралелізму у фронтенді компілятора: Faster compilation with the parallel front-end in nightly. Спочатку планувалося зробити його доступним у стабільному Rust у 2024, але, як ми бачимо, не склалося.

Ну і власне уся суть пришвидшення в увімкненні Cranelift 😁 Для цього потрібно зробити 2 речі:
1. Встановити:
rustup update nightly
rustup component add rustc-codegen-cranelift --toolchain nightly

2. Конфігурувати:
# .cargo/config.toml
[build]
rustflags = ["-Z", "threads=8"]

[unstable]
codegen-backend = true

# you can customize profiles
[profile.dev]
codegen-backend = "cranelift"

Тепер при компіляції проекту через cargo +nightly build використовуватиметься Cranelift замість LLVM.

Недоліки:
🔴 Використання нестабільної версії Rust. Тому ми рекомендуємо використовувати це тільки для debug компіляцій, а для релізів брати тільки стабільну версію Rust.
🔴 Cranelift може генерувати трохи повільніший код ніж LLVM. Зазвичай для debug білдів це не страшно, але варто мати на увазі.

Корисні посилання:
🟡 Faster compilation with the parallel front-end in nightly.
🟣 github/rust-lang/rustc_codegen_cranelift.
🔘 doc.rust-lang.org/nightly/cargo/reference/unstable#codegen-backend.
🔘 doc.rust-lang.org/cargo/reference/profiles.
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥11👍2



tgoop.com/learn_rust_ukr/254
Create:
Last Update:

Сьогодні поговоримо про цікавий спосіб пришвидшити компіляцію Rust проекту у 1.5 – 2.5 разів 😁

На цей пост надихнув пост Інгвара у Bluesky ➡️ https://bsky.app/profile/rreverser.com/post/3lhtsq7revk2c

Трохи історії. У листопаді 2023 року робоча група Parallel Rustc (The Parallel Rustc Working Group) анонсували використання Cranelift як альтернативного бекенду компілятора для когодегенерації та можливості паралелізму у фронтенді компілятора: Faster compilation with the parallel front-end in nightly. Спочатку планувалося зробити його доступним у стабільному Rust у 2024, але, як ми бачимо, не склалося.

Ну і власне уся суть пришвидшення в увімкненні Cranelift 😁 Для цього потрібно зробити 2 речі:
1. Встановити:

rustup update nightly
rustup component add rustc-codegen-cranelift --toolchain nightly

2. Конфігурувати:
# .cargo/config.toml
[build]
rustflags = ["-Z", "threads=8"]

[unstable]
codegen-backend = true

# you can customize profiles
[profile.dev]
codegen-backend = "cranelift"

Тепер при компіляції проекту через cargo +nightly build використовуватиметься Cranelift замість LLVM.

Недоліки:
🔴 Використання нестабільної версії Rust. Тому ми рекомендуємо використовувати це тільки для debug компіляцій, а для релізів брати тільки стабільну версію Rust.
🔴 Cranelift може генерувати трохи повільніший код ніж LLVM. Зазвичай для debug білдів це не страшно, але варто мати на увазі.

Корисні посилання:
🟡 Faster compilation with the parallel front-end in nightly.
🟣 github/rust-lang/rustc_codegen_cranelift.
🔘 doc.rust-lang.org/nightly/cargo/reference/unstable#codegen-backend.
🔘 doc.rust-lang.org/cargo/reference/profiles.

BY Українська Rust Спільнота




Share with your friend now:
tgoop.com/learn_rust_ukr/254

View MORE
Open in Telegram


Telegram News

Date: |

Deputy District Judge Peter Hui sentenced computer technician Ng Man-ho on Thursday, a month after the 27-year-old, who ran a Telegram group called SUCK Channel, was found guilty of seven charges of conspiring to incite others to commit illegal acts during the 2019 extradition bill protests and subsequent months. How to Create a Private or Public Channel on Telegram? Just as the Bitcoin turmoil continues, crypto traders have taken to Telegram to voice their feelings. Crypto investors can reduce their anxiety about losses by joining the “Bear Market Screaming Therapy Group” on Telegram. Members can post their voice notes of themselves screaming. Interestingly, the group doesn’t allow to post anything else which might lead to an instant ban. As of now, there are more than 330 members in the group. The administrator of a telegram group, "Suck Channel," was sentenced to six years and six months in prison for seven counts of incitement yesterday.
from us


Telegram Українська Rust Спільнота
FROM American