Archived
1
Fork 0
A fast boids library for Rust
This repository has been archived on 2021-09-03. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
2021-09-03 14:12:36 -04:00
.github/workflows demo 2021-09-03 14:12:36 -04:00
.vscode Boids, now more abstract 2021-09-03 12:25:43 -04:00
examples Flock targeting 2021-09-03 14:05:07 -04:00
src Flock targeting 2021-09-03 14:05:07 -04:00
.gitignore Initial commit 2021-09-03 09:50:23 -04:00
Cargo.toml Fix repo links 2021-09-03 14:11:49 -04:00
LICENSE Initial commit 2021-09-03 09:50:23 -04:00
README.md demo 2021-09-03 14:12:36 -04:00
screenrec001.gif README work 2021-09-03 14:11:03 -04:00

boids

Crates.io Docs.rs

The boids crate is a reasonably fast implementation of the Boids algorithm. If you have speed improvements, please submit a pull request!

Parallel processing & speed

When compiled with the rayon feature enabled, the library will use the rayon crate to parallelize the computation. This may or may not be something you want to do, depending on your application.

Boid count Single-thread Time Parallel Time
100 7.3ms 3.5ms
1000 414ms 42.5ms
10000 ??? 3.4s

Features

  • rayon: Enable parallel processing
  • serde: Enable serde support for all types
  • puffin: Enable support for the puffin profiler
    • Note: puffin_viewer requires the packages libgtk-3-dev libatk1.0-dev libsdl-pango-dev libcairo2-dev

Demo

You can run the demo app with

cargo run --example showcase --features rayon