What allocator are you using? A sizeclass allocator like snmalloc won’t get slower if you allocate large objects and I’d expect it to have really good performance for this kind of use (that doesn’t negate any of the other improvements but it makes me wonder if you’re leaving some easy performance wins out).
Clojure (and thus jank) is a garbage collected language, so we generally rely on our GC to do the allocating. Right now, jank is using the Boehm GC, which is indeed not the fastest on the market. I have future work planned to port MMTK to jank and take advantage of LXR, but it’ll be a while before I pick that up.
In terms of what Boehm is doing, it uses mmap or sbrk on Unix platforms by default, but it can use a custom method to get heap memory from the OS. The author has doubts that there’s any benefit of using other allocators, since Boehm just grabs big page-aligned chunks from OS.
Thanks, you probably won’t get much benefit combining another allocator with Boehm. Are you using the typed allocation stuff with Boehm? This can reduce the set of thing that it tries to scan if you know where the pointer fields are.
Hmmmm, I’m not. I’m keeping constexpr bools for whether types are pointer-free, but I completely missed the typed portion of Boehm. Looks like the readme just has this one line:
There are provisions for allocation with explicit type information. This is rarely necessary. Details can be found in gc_typed.h.
I’ve scanned through the header and it seems promising. I really appreciate that suggestion. :D
What allocator are you using? A sizeclass allocator like snmalloc won’t get slower if you allocate large objects and I’d expect it to have really good performance for this kind of use (that doesn’t negate any of the other improvements but it makes me wonder if you’re leaving some easy performance wins out).
Hey! Thanks for the suggestion.
Clojure (and thus jank) is a garbage collected language, so we generally rely on our GC to do the allocating. Right now, jank is using the Boehm GC, which is indeed not the fastest on the market. I have future work planned to port MMTK to jank and take advantage of LXR, but it’ll be a while before I pick that up.
In terms of what Boehm is doing, it uses mmap or sbrk on Unix platforms by default, but it can use a custom method to get heap memory from the OS. The author has doubts that there’s any benefit of using other allocators, since Boehm just grabs big page-aligned chunks from OS.
Thanks, you probably won’t get much benefit combining another allocator with Boehm. Are you using the typed allocation stuff with Boehm? This can reduce the set of thing that it tries to scan if you know where the pointer fields are.
Hmmmm, I’m not. I’m keeping constexpr bools for whether types are pointer-free, but I completely missed the typed portion of Boehm. Looks like the readme just has this one line:
I’ve scanned through the header and it seems promising. I really appreciate that suggestion. :D