Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add tcmalloc support to the tikv_alloc crate #4370
Re-PR from #4207
Add tcmalloc support to the tikv_alloc crate for issues #4191
referenced this pull request
Mar 13, 2019
Hi again @ZhangHanDong!
I spent some time looking at this tonight, and it looks good to me
There's a bit of a problem though: there's some new jemalloc code on master
I will propose a fix for that in another PR shortly, and I'll ping
Since this PR is passing tests we could merge it before that PR,
Will you be interested in doing any performance comparisons between the two allocators?
Heh, I haven't really thought much about how to do it, but here are some ideas, from easy to hard.
Those are all the ideas I've got right now.
@yiwu-arbug has been working with jemalloc recently. Maybe they have better ideas about how to compare jemalloc to tcmalloc.
Edit: measuring fragmentation under load would be very good, but I don't know how to do it.
brson left a comment
I pushed a commit that fixes the merge conflicts.
In the process I discovered that the tcmalloc crate doesn't build tcmalloc. It's just a small set of declarations that expect tcmalloc to exist in the linker path. Eventually that will need to change for Rust projects to use the tcmalloc crate, but it's good enough for casual testing.
I'm inclined to go ahead and merge this without measurements in the hopes that myself or someone else will circle back and do an evaluation. And maybe now that the multi-malloc structure is in place we can also experiment with other allocators.