rpmalloc-zig-port icon indicating copy to clipboard operation
rpmalloc-zig-port copied to clipboard

links to benchmarks, testing, metrics + docs

Open matu3ba opened this issue 2 years ago • 2 comments

Great idea to port rpmalloc. I suggested this also on reddit. :)

benches

  • https://github.com/daanx/mimalloc-bench
  • https://github.com/mjansson/rpmalloc-benchmark

testing

  • https://www.ryanliptak.com/blog/improving-fuzz-testing-with-zig-allocators/
  • https://github.com/emeryberger/hangover
  • valgrind with binding to the c api

metrics + docs

  • https://stackoverflow.com/questions/16099646/how-to-evaluate-the-quality-of-custom-memory-allocator
  • Influence of Cache configuration options are not well explained/measured.
  • Notable missing docs of rpmalloc: ENABLE_GUARDS fragmentation costs and running some of the benchmarks provided by other malloc implementors.

matu3ba avatar Dec 01 '22 17:12 matu3ba

Thank you for the links.

I'll note here that although I've left a good few of the ENABLE_GUARDs in tact, I did explicitly decide to omit a few, namely:

  • ENABLE_STATISTICS: to simplify code
  • ENABLE_ADAPTIVE_THREAD_CACHE: similar reason to ENABLE_STATISTICS. But as opposed to what the name would lead one to believe, it doesn't actually appear to be used in any sort of adaptive thread caching, seeming to exclusively exist as an add-on to ENABLE_STATISTICS.
  • ENABLE_OVERRIDE & ENABLE_PRELOAD: laziness and lack of infrastructure
  • ENABLE_VALIDATE_ARGS: most of the validation this enabled seemed like it shouldn't be disabled in the first place, and the one instance where it seemed reasonable seemed like it'd be better determined by std.debug.runtime_safety.

That is of course all based partly off of investigation and my intuition.

InKryption avatar Dec 01 '22 18:12 InKryption

Ah, lol. I did no expect the port to be done already. My criticism on missing metrics + docs was mainly on the upstream project.

matu3ba avatar Dec 01 '22 19:12 matu3ba