Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

benchmarks-rs

GitHub Actions Workflow Status GitHub last commit GitHub License

A high-performance, zero-dependency CPU benchmark tool designed to measure single-core and multi-core floating-point (FP64) processing capabilities.

Originally implemented in Go, this project has been fully rewritten in Rust to achieve maximum performance and minimal binary size through aggressive compiler optimizations.

Features

  • Zero Dependencies: Built entirely using the Rust standard library (std). No third-party crates are required.
  • Maximum Optimization: Compiled with opt-level = 3, Link Time Optimization (LTO), and stripped symbols to ensure the smallest possible footprint and highest throughput.
  • FMA Simulation: Workloads simulate Fused Multiply-Add (FMA) operations with aggressive loop unrolling to maximize Instruction-Level Parallelism (ILP) and keep CPU execution ports fully saturated.
  • Accurate Multithreading: Uses std::sync::Barrier to ensure all worker threads start their computational loops at the exact same microsecond, preventing skewed multi-core scaling results.
  • Native Cross-Platform CI: Automated GitHub Actions workflows compile native, statically linked binaries for:
    • macOS (Apple Silicon: aarch64-apple-darwin)
    • Linux (x86_64-unknown-linux-musl)
    • Windows (x86_64-pc-windows-gnu)

Installation

You can download the latest pre-compiled binaries for your operating system directly from the Releases page.

Usage

Run the executable from your terminal. By default, the benchmark will run for 3 seconds per phase (single-core, then multi-core).

# Run with default settings (3 seconds per phase)
./benchmarks

# Specify a custom duration (e.g., 5 seconds per phase)
./benchmarks -t 5

Examples

Run benchmarks on macOS:

% ./benchmarks
=================================================================
 Rust CPU Float64 Benchmark Tool (v0.1.2)
-----------------------------------------------------------------
 Arch         : aarch64 / macos
 Logical CPUs : 10
 Precision    : Float64 (Double Precision)
 Mode         : FMA Simulation (ILP Optimized)
=================================================================

[1/2] Running Single-Core Benchmark... Done.
[2/2] Running Multi-Core Benchmark (10 Threads)... Done.

=================================================================
 BENCHMARK RESULTS
=================================================================
 Single-Core Performance :      20.85 GFLOPS
 Multi-Core Performance  :     142.40 GFLOPS
-----------------------------------------------------------------
 Multi-Core Scaling      :       6.83x
=================================================================
 Note: Results represent pure FP64 throughput in Rust environment.
 Values are approx. 60-80% of theoretical hardware limits due
 to compiler auto-vectorization constraints.
=================================================================

Building from Source

If you prefer to build the tool yourself, ensure you have the Rust toolchain installed, then clone the repository and run:

git clone https://github.com/QChemX/benchmarks-rs.git
cd benchmarks-rs
cargo build --release

The optimized executable will be located in ./target/release/.

License

This project is licensed under the GNU General Public License v3.0 (GPLv3). See the LICENSE file for more details.

About

A CPU float64 benchmark tool.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages