Rust Benchmarks repository.
The intent of this repository is to provide proofs, using benchmarks, that solutions to common logical operations are optimal.
Rust has emerged as a popular systems language with intent of solving problems that traditionally relied on C/C++. Memory safety and zero-cost abstractions promise to deliver optimized applications reaching physical computation limits.
In many ways, Rust is C++ re-imagined.
Testing provides data based development decisions.
Standard Output
$ cargo benchVerbose Output
$ cargo bench -- --verboseThese benchmarks are designed for experimentation and the pursuit of knowledge but it should be noted that the Rust compiler does a great deal to push towards the limits of computation.
Premature optimization can hurt an engineer's performance but having intuition as to how a language performs improves decision making downstream outweighing any upfront cost.
Memory-safety is a first-class citizen in Rust. Rather than rewrite "the book", please see official Rust references for memory-safety details.
References:
The Rust compiler, ideally, assembles operations identically regardless of high-level language implementations (Rust source code).
For example, writing a custom "sum" function compared with a standard lib or similar function emitted as assembly would yield the same results given the same arguments and return value type. The source code or abstraction should compile to the same optimized assembly regardless of trivial variance in implementations.
Abstractions can be compared by compiling source code as assembly:
cargo rustc -- --emit asmRelease optimized assembly:
cargo rustc --release -- --emit asmMIT