Shnatsel/bounds-check-cookbook

Recipes for avoiding bounds checks in Rust, without unsafe!

Rust

147

24 commits

updated Jan 17, 2023

See the code

README

Recipes for avoiding bounds checks in Rust

This repository showcases various approaches to avoiding bounds checks in Rust code, without unsafe code.

Each code snippet includes a command to view its assembly. Install cargo-show-asm to run them, and hyperfine to benchmark the snippets:

cargo install cargo-show-asm hyperfine

An article with all the details:

How to avoid bounds checks in Rust (without unsafe!)

Contributors

Shnatsel

24 commits

Shnatsel/bounds-check-cookbook

Recipes for avoiding bounds checks in Rust, without unsafe!

Rust

147

24 commits

updated Jan 17, 2023

See the code

README

Recipes for avoiding bounds checks in Rust

This repository showcases various approaches to avoiding bounds checks in Rust code, without unsafe code.

Each code snippet includes a command to view its assembly. Install cargo-show-asm to run them, and hyperfine to benchmark the snippets:

cargo install cargo-show-asm hyperfine

An article with all the details:

How to avoid bounds checks in Rust (without unsafe!)

Contributors

Shnatsel

24 commits

Languages

Rust

100.0%