Crates.io | frusa |
lib.rs | frusa |
version | 0.1.2 |
source | src |
created_at | 2023-03-11 20:00:39.359706 |
updated_at | 2024-02-29 17:00:22.324227 |
description | A system allocator with reclaim. |
homepage | |
repository | https://github.com/moturus/motor-os |
max_upload_size | |
id | 807497 |
size | 53,151 |
Fast RUst System Allocator
Another implementation of core::alloc::GlobalAlloc (Rust)
A system allocator should be reasonably fast, should be able to request more memory, and allow memory reclaim. I needed one at the beginning of 2023, and at this time none of the allocators I could find on crates.io matched the requirements.
#[GlobalAllocator]
$ cargo test --release concurrent_speed_test -- --nocapture
[...]
------- FRUSA Allocator ---------------
concurrent speed test: 1 threads: 59.48 ns per alloc/dealloc; throughput: 16.81 ops/usec
concurrent speed test: 2 threads: 198.80 ns per alloc/dealloc; throughput: 10.06 ops/usec
concurrent speed test: 4 threads: 465.11 ns per alloc/dealloc; throughput: 8.60 ops/usec
concurrent speed test: 8 threads: 1339.12 ns per alloc/dealloc; throughput: 5.97 ops/usec
------- Rust System Allocator ----------
concurrent speed test: 1 threads: 19.54 ns per alloc/dealloc; throughput: 51.17 ops/usec
concurrent speed test: 2 threads: 22.67 ns per alloc/dealloc; throughput: 88.22 ops/usec
concurrent speed test: 4 threads: 23.47 ns per alloc/dealloc; throughput: 170.44 ops/usec
concurrent speed test: 8 threads: 26.92 ns per alloc/dealloc; throughput: 297.21 ops/usec
------- Talc System Allocator ----------
concurrent speed test: 1 threads: 41.85 ns per alloc/dealloc; throughput: 23.89 ops/usec
concurrent speed test: 2 threads: 311.50 ns per alloc/dealloc; throughput: 6.42 ops/usec
concurrent speed test: 4 threads: 697.42 ns per alloc/dealloc; throughput: 5.74 ops/usec
concurrent speed test: 8 threads: 2196.38 ns per alloc/dealloc; throughput: 3.64 ops/usec