Skip to content

gregl83/rust-benched

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-benched

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.

Usage

Standard Output

$ cargo bench

Verbose Output

$ cargo bench -- --verbose

Considerations

These 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

Memory-safety is a first-class citizen in Rust. Rather than rewrite "the book", please see official Rust references for memory-safety details.

References:

Zero-Cost Abstractions

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 asm

Release optimized assembly:

cargo rustc --release -- --emit asm

References

License

MIT

About

Rust Benchmarks

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages