SFBdragon / talc

A fast and flexible allocator for no_std and WebAssembly
https://crates.io/crates/talc
MIT License
419 stars 9 forks source link

Add some TLSF crate to benchmarks #26

Closed speps closed 8 months ago

speps commented 8 months ago

TLSF (Two Level Segregated Fit) is a popular embedded allocator. It'd be good to add it as it'd likely beat dlmalloc in a single threaded environment.

There are a few places where it's implemented in Rust:

The rlsf crate seems like the most maintained and with existing benchmarks vs dlmalloc too.

SFBdragon commented 8 months ago

Went with rlsf, and beat Dlmalloc it did! And often edges out Talc in performance, too. I ought to go read up on its design. Thanks for bringing it to my attention.

Anyhow, I'll close this. You can view the results in the README.

SFBdragon commented 8 months ago

I've just read the TLSF paper. Talc is remarkably similar to the TLSF algorithm, especially in that it uses a list segregation strategy that uses powers of two and subdivides them linearly. I just didn't make the list two-level, which is a fairly easy change that simplifies certain operations and should improve performance.

Once again, thanks for making me aware of it!

speps commented 8 months ago

No problem, I discovered it last year even though it's been around a while and was very useful in one of my side projects 😉