3 ms·
yesn't codegen in the OP article is machine gode generation (i.e. running LLVM) It's semantically kinda like having a single 100k file, but because rust knows
by dathinab 2y ago
yesn't
codegen in the OP article is machine gode generation (i.e. running LLVM)
It's semantically kinda like having a single 100k file, but because rust knows it often generates huge "files" there is a splitting step, somewhere between parsing AST and generating machine code (I think after generating MIR but not fully sure). And the codgen-unit setting is in how many parts rust is allowed to split a thing which semantically is just one code unit. By default for release builds 16 (and as it can affect perf. of generated code it's not based on #cpus). But in there case there seems to be a bug which makes it effective more like 1! Which is much worse then it should be. (But also the statistic they show aren't sufficient to draw too much conclusions).