snmalloc icon indicating copy to clipboard operation
snmalloc copied to clipboard

Q: How does the performance compare with mimalloc?

Open sirinath opened this issue 4 years ago • 8 comments

  1. How does the performance compare with mimalloc?
  2. Can the features developed here eventually added to mimalloc?

sirinath avatar Jan 24 '21 12:01 sirinath

  1. Performance is pretty similar. There are examples where snmalloc out performs mimalloc and there are examples where mimalloc out performs snmalloc. snmalloc tends to do better in very asymmetric producer consumer allocation patterns, but again it is very much down to the benchmark. @sirinath do you have a particular use case in mind?

  2. If we find things work well, I am sure @daanx would be open to adding them to mimalloc. There are some core difference in how mimalloc and snmalloc work, but the designs are very close in most regards, so porting ideas should work well. We pulled several aspects of how mimalloc works into snmalloc after mimalloc was published. Long term, I think both @daanx and I would like to combine into a single allocator, but haven't worked out how to do that.

@sirinath do you have a feature in mind?

mjp41 avatar Jan 24 '21 13:01 mjp41

  1. Performance is pretty similar. There are examples where snmalloc out performs mimalloc and there are examples where mimalloc out performs snmalloc. snmalloc tends to do better in very asymmetric producer consumer allocation patterns, but again it is very much down to the benchmark. @sirinath do you have a particular use case in mind?
  2. If we find things work well, I am sure @daanx would be open to adding them to mimalloc. There are some core difference in how mimalloc and snmalloc work, but the designs are very close in most regards, so porting ideas should work well. We pulled several aspects of how mimalloc works into snmalloc after mimalloc was published. Long term, I think both @daanx and I would like to combine into a single allocator, but haven't worked out how to do that.

@sirinath do you have a feature in mind?

It seems like mimalloc has been unmaintained since two months ago. I don't know if there's any exclusive features of it that can be ported to snmalloc as well.

enihcam avatar Sep 15 '23 01:09 enihcam

I don't believe mimalloc is unmaintained. @daanx is out of office at the moment so I can't double check with him. But generally he does a big push on mimalloc support every few months.

mjp41 avatar Sep 15 '23 05:09 mjp41

mimalloc is the default allocator used in Koka. So it is being maintained, I suppose.

SchrodingerZhu avatar Sep 16 '23 18:09 SchrodingerZhu

Could you plant pareto principles from scalloc?

In my benchmarks, it even outperforms jemalloc on skylake.

https://github.com/cksystemsgroup/scalloc

osevan avatar Oct 12 '23 08:10 osevan

@osevan it is a while since I read the scalloc paper. If you could say a bit more about your suggestion that would be helpful.

Also, could you share the benchmarks? Or even add them to mimalloc-bench? Seeing benchmarks can often help understand the weaknesses of certain aspects of the design.

mjp41 avatar Oct 12 '23 08:10 mjp41

My benchmarks are old and i did that after scalloc appear in world.

And i cant find my Benchmarks :-(

Btw i was in my tests fastest one on skylake with lowest latancy.

I tested several benches with jemalloc tcmalloc rpmalloc and lockless lalloc and in case where lowest latency possible was scalloc thread creation bench , the best.

I think you can try to fix compile errors with latest gcc and clang and we can test this again.

osevan avatar Oct 12 '23 21:10 osevan

Is this one https://github.com/daanx/mimalloc-bench/pull/90 fixed in mimalloc-bench?

osevan avatar Oct 12 '23 21:10 osevan