1 unstable release

Uses new Rust 2024

0.15.0 Mar 15, 2025

#334 in Game dev

Download history 121/week @ 2025-03-12

121 downloads per month

MIT/Apache

415KB
1K SLoC

Rust 1K SLoC // 0.0% comments WebGPU Shader Language 272 SLoC // 0.3% comments

Bevy Radix Sort

A low-level, high-performance GPU-based radix sort plugin for Bevy, optimized for sorting key/value pairs of type u32.

Crates.io MIT/Apache 2.0

Features

  • Based on the paper Fast 4-way parallel radix sorting on GPUs
  • High-performance radix sort implementation fully executed on the GPU
  • High compatibility, capable of running on most modern GPUs
  • Efficient for large datasets with minimal CPU overhead

Limitations

  • Currently not supported on web platforms (due to the lack of push_constants support in the WebGPU standard)
  • Optimized specifically for u32 key/value pairs

Installation

Add the following dependency to your Cargo.toml:

[dependencies]
bevy_radix_sort = "0.15.0"

Benchmark

Important Note on GPU Benchmarking:

Designing automated GPU benchmarks in Bevy presents significant challenges. Benchmark results can vary widely across different platforms, hardware configurations, and driver versions, making it difficult to provide standardized performance metrics.

For accurate performance analysis, I recommend using GPU-specific profiling tools:

These tools provide detailed insights into GPU execution times, memory usage, and potential bottlenecks that simple timing measurements cannot capture.

Performance Results

Below are benchmark results from testing on an NVIDIA RTX 4070 Ti Super:

RTX 4070 Ti Super Benchmark

Number of Key-Value Pairs Execution Time (ms)
10,000 0.12
100,000 0.19
1,000,000 0.43
10,000,000 2.30

Note: Performance may vary based on system configuration, driver version, and concurrent GPU workloads.

Usage

Check out the example implementation to see how to integrate the radix sort into your Bevy application.

Contributing

Contributions are welcome! Feel free to submit issues or pull requests on our GitHub repository.

License

Licensed under either of

at your option.

Dependencies

~24–35MB
~582K SLoC