> We now run LLVM in parallel while generating code, which should reduce peak memory usage.
I did a double take there, since more parallelism often has the opposite effect (like computation, memory usage that would be spread out over time now happens at once, causing more memory overhead). The linked github issue[0] explains though:
> It also allows the main thread to switch between either translation or running LLVM, which allows to reduce peak memory usage since not all LLVM module have to be kept in memory until linking.
So I guess the idea is: the code that has already been translated can be processed by LLVM before all translation is finished, so it can also be released earlier. Very nice!
I did a double take there, since more parallelism often has the opposite effect (like computation, memory usage that would be spread out over time now happens at once, causing more memory overhead). The linked github issue[0] explains though:
> It also allows the main thread to switch between either translation or running LLVM, which allows to reduce peak memory usage since not all LLVM module have to be kept in memory until linking.
So I guess the idea is: the code that has already been translated can be processed by LLVM before all translation is finished, so it can also be released earlier. Very nice!
[0] https://github.com/rust-lang/rust/pull/43506