pierd.github.io


Project maintained by pierd Hosted on GitHub Pages — Theme by mattgraham

Rust

Auditing for security vulnerabilities

Benchmarking

More info here in performance book.

Important to use RUSTFLAGS="-C target-cpu=native" to let the compiler use instructions specific to the current CPU.

Tools:

Books

Code coverage

Error handling

Faster linking

Put this in .cargo/config.toml in your project to use lld or zld instead of default linker.

# On Windows
# ```
# cargo install -f cargo-binutils
# rustup component add llvm-tools-preview
# ```
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]

[target.x86_64-pc-windows-gnu]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]

# On Linux:
# - Ubuntu, `sudo apt-get install lld clang`
# - Arch, `sudo pacman -S lld clang`

[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=lld"]

# On MacOS, `brew install michaeleisel/zld/zld`

[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld"]

[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld"

More info why is here.

Logging / tracing

Utilities

tags: rust