Hacker News new | ask | show | jobs
by juststeve 1517 days ago
The 3x speed increase is interesting. Do you have any further details?
2 comments

Only 3x speed increase feels like either did PHP a very good job or the port is not optimized for rust yet.
A 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.
Yes — 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.
what's the total running time? ms/sec/minutes/hours? is it heavy IO bound?
A 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.