mimalloc icon indicating copy to clipboard operation
mimalloc copied to clipboard

v3 vs v2

Open Jura-Z opened this issue 8 months ago • 1 comments

Hey! Thanks for the great allocator, we're testing v3 and it is MUCH more better than v2.

Wondering where can I read more about the difference? Any risks in using v3 in production?

Thank you!

Jura-Z avatar Apr 14 '25 18:04 Jura-Z

The README says this about the dev3 branch (emphasis mine):

development branch for mimalloc v3-beta. This branch is downstream of dev. This version simplifies the lock-free ownership of previous versions, has no thread-local segments any more. This improves sharing of memory between threads, and on certain large workloads may use less memory with less fragmentation.

With that said, I'd love to know what needs to be done to get v3 over the finish line and declare it production ready.

skreborn avatar Apr 23 '25 17:04 skreborn

I would say v3 is production ready as it is already running at large scale on some big services -- I will soon remove the beta tag. However, there are still some benchmarks (in Lean) where v3 performance is bit worse than v2 (~10 to 20%) and I would like to still address this. Generally though with the reduced memory usage, v3.1.5+ is nowadays preferable.

daanx avatar Jun 14 '25 19:06 daanx

@daanx I see that there are both v3.0.x and v3.1.x versions. Which one would you suggest?

pitrou avatar Sep 17 '25 13:09 pitrou

@pitrou In their previous comment, they mentioned that "Generally though with the reduced memory usage, v3.1.5+ is nowadays preferable."

skreborn avatar Sep 17 '25 13:09 skreborn

@pitrou In their previous comment, they mentioned that "Generally though with the reduced memory usage, v3.1.5+ is nowadays preferable."

That was answering the v3 vs. v2 question, but did not address the v3.0 vs. v3.1 question...

pitrou avatar Sep 17 '25 13:09 pitrou

I see that there was indeed a new 3.0.9 release about two weeks ago, but as far as I can tell, all the changes since the 3.0.8 version were those backported from the 3.1.x line. It's true, however, that those same changes to the 3.1.x line have not been tagged as a release yet—so in essence 3.0.9 contains fixes that came after 3.1.5 (even if those changes are available on the dev3 branch).

skreborn avatar Sep 17 '25 14:09 skreborn

Ok, thanks @skreborn . I'll try switching to v3.0.9 in Apache Arrow then.

pitrou avatar Sep 17 '25 14:09 pitrou