Others / shredder

Garbage collected smart pointers for Rust
MIT License
266 stars 9 forks source link

Refactor the collector to use reference counting #74

Open Others opened 2 years ago

Others commented 2 years ago

This is around a ~4x speedup, but required a lot of code changes. In terms of public API, only AtomicGc has a significant diff. (The old API would still work, but the changes make it work more efficently with the new internals.)

jrmuizel commented 2 years ago

A 4x speed up on what?

Others commented 2 years ago

@jrmuizel a 4x speedup on the stress test I use to benchmark the collector: https://github.com/Others/shredder/blob/master/tests/stress.rs On my machine it goes from ~12 to ~3 seconds.

This benchmark kinda blows, and I've had an issue to create new ones for a while (#7). But I'm pretty sure that this new design is significantly better on a number of axises anyway, as it removes the dumb parts of the collector where we keep a list of every Gc in the program.

Others commented 2 years ago

See #74