6 ms·
The 3x speed increase is interesting. Do you have any further details?
by juststeve 4y ago
The 3x speed increase is interesting. Do you have any further details?
- muglug 4y agoYes — that's after a ton of Rust-centric optimisation. About 25% of the runtime is currently consumed with deallocating memory (there are a lot of heavily-nested data structures getting cleaned up), so there's definitely some more work to be done to reduce cloning.
- juststeve 4y agowhat's the total running time? ms/sec/minutes/hours? is it heavy IO bound?
- muglug 4y agoA few minutes. It's not heavily IO-bound — it's mostly memory-bound (it's a type-checking tool for very large codebases). Further (painful) optimisations will likely involve the use of arenas to prevent so many atomic de-allocations.
- tored 4y agoOnly 3x speed increase feels like either did PHP a very good job or the port is not optimized for rust yet.
- muglug 4y agoA bit of one, a bit of the other. It's fairly well-optimised. I think the big remaining optimisation will be to de-allocate memory less frequently — the program creates and destroys millions of structs representing types. 20% of the runtime is taken up iterating over and dropping collections of type-related structs.