-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce LLVM code generation #5859
Conversation
The current changes look good to me. Since this is marked as a draft, is there anything else you would like to change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to me!
i wonder if there are other places in the codebase where a function is monomorphized over multiple type parameters but only needs to be monomorphized over one of them. of course, code that's generated per-future is almost certainly the biggest culprit in terms of build time...
It's now ready to merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks reasonable enough. These all reduce codegen according to a benchmark you did?
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
It decreases total LLVM lines in Lemmy by 8.5% |
Thanks. |
This reduces the amount of LLVM code generated, which is helpful for compilation speed.
Motivation
A big portion of LLVM code generation for Lemmy server is caused by a few Tokio functions: cargo llvm-lines output
It would be helpful to reduce this because it contributes to Lemmy's extremely slow compilation.
Solution
Split parts of functions into separate functions without unneeded generic parameters: https://nnethercote.github.io/perf-book/compile-times.html#llvm-ir