Re:How to speed up the Rust compiler some more
by marcosdumay on Wednesday November 23, 2016 @11:01AM
(#13023479)
Also, make sure #1 is done atomically. Your request will either get in a queue, wait for a mutex, or create many more of #2 than needed because the pool isn't shared between threads.
Re:How to speed up the Rust compiler some more
by valarauca1 on Wednesday November 23, 2016 @11:34AM
(#13023723)
Rust uses jemalloc which has per-thread-pooling (sort of). There is very little lock contention as there are multiple pools per-thread.
Also per thread pooling doesn't use more memory then not. In some cases it actually uses less. Citation: https://people.freebsd.org/~jasone/jemalloc/bsdcan2006/jemal...
This is done efficiently, but modifying these collections take time. AND IT STILL FASTER THEN:
2. Calling the kernel to MMAP in new virtual memory, adding that to the pool, and well restarting this process all over again.
Allocation time is a big cost, and there is work to make allocation lazy by default in the Rust Compiler at the minute.