4 releases
Uses new Rust 2024
new 0.0.1-pre.4 | Mar 14, 2025 |
---|---|
0.0.1-pre.3 | Mar 13, 2025 |
0.0.1-pre.2 | Mar 8, 2025 |
#26 in #memory-region
307 downloads per month
Used in linked
13KB
216 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
~205–640KB
~15K SLoC