19 releases

Uses new Rust 2024

new 0.2.2 Jun 13, 2025
0.2.1 Jun 5, 2025
0.2.0 May 8, 2025
0.1.8 Apr 18, 2025
0.0.5 Mar 26, 2025

#11 in #hardware-aware

Download history 384/week @ 2025-03-08 335/week @ 2025-03-15 589/week @ 2025-03-22 508/week @ 2025-03-29 198/week @ 2025-04-05 125/week @ 2025-04-12 69/week @ 2025-04-19 13/week @ 2025-04-26 105/week @ 2025-05-03 75/week @ 2025-05-10 11/week @ 2025-05-17 116/week @ 2025-05-31 112/week @ 2025-06-07

241 downloads per month
Used in 3 crates (via linked)

MIT license

25KB
226 lines

Folo

Mechanisms for high-performance hardware-aware programming in Rust.

The design tenets this project aims to satisfy are the following:

  • In services, keep the processing of each request on a single processor to ensure both that data is locally cached for fast access and to avoid polluting caches of many processors with data of a single request.
  • Be aware of memory region boundaries when scheduling work and placing data. Avoid moving data across these boundaries because it can be very slow.
  • Use single-threaded logic without synchronization - even atomics and "lock-free" synchronization primitives are expensive compared to single-threaded logic. Whenever feasible, use !Send types to avoid accidental multithreading. Maintain separate mutable data sets per thread or memory region instead of maintaining global data sets.
  • Use asynchronous logic in the app, in library code and when communicating with the operating system, ensuring that a thread is never blocked from doing useful work.

Contents

This is an umbrella project that covers multiple largely independent crates:

Crate Description
linked + siblings Create families of linked objects that can collaborate across threads while being internally single-threaded
many_cpus Efficiently schedule work and inspect the hardware environment on many-processor systems
region_cached Add a layer of cache between L3 and main memory
region_local Isolate variable storage per memory region, similar to thread_local!

Some auxiliary crates are also published because the primary crates above require their functionality. They only indirectly contribute to the Folo mission, so are listed separately:

Crate Description
cpulist Utilities for parsing and emitting Linux cpulist strings
many_cpus_benchmarking Criterion benchmark harness to easily compare different processor configurations

There are also some development-only crates in this repo, which are not published:

Crate Description
benchmark_utils Common benchmarking logic used across the crates in this project
benchmarks Random pile of benchmarks to explore relevant scenarios and guide Folo development

Development environment setup

See DEVELOPMENT.md.

Dependencies

~170–580KB
~14K SLoC