-
-
Notifications
You must be signed in to change notification settings - Fork 811
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
Investigate compile time of serde crate #1146
Comments
Here is part of it: rust-lang/rust#47628. |
Building the same commit (59017aa19b48a2fff795f4e1915dbb596ac427db) with some newer compilers:
|
One thought I had today about the compile time of the serde crate is that it very frequently nowadays has the There's not really a solution to this today per se. A workaround is to meticulously only use Put another way though the compile time of One "quick" way to improve the comiple time of the Edit: For a more visceral view of what I mean about |
Thanks, I can see how that would help. That is a neat visualization. It is unfortunate that most people would probably perceive it the opposite way if we make this change -- more crates = more bloat = perceived as slow, even if it builds end-to-end faster than the current setup. |
Here's another data point of a different graph I've seen: That's got a lot of dependencies pruned, but the entire compilation of Anyway, as I already wrote on the forums, there's a feature request on rustc to enable this pipelining and I agree that in general users (even serde) shouldn't have to, in the long term, use a crate organization like this just to get better compile times. |
I have a bunch of observations/questions here! To me, it seems another issue is that the code that uses serde_derive is slow to compile. Specifically, it seems that JSON serialization turns out to be a non-trivial part of rust-analyzer's overall compile time. I can't measure that directly, but the following two high-level benches nod in that direction: First, if I run
Second, if I run
It seems to be that sered-using crates are both heavy to compile themselves, as well as add downstream monomorphisations to the consumers. With this in mind, I have the following questions (extremely vague, mind you!):
|
We were doing so well for a few rustc releases. Building the current master branch of serde:
But since then it has been going up and up:
Will need to look into what makes the current code take 50% longer to build with a modern compiler compared to an old compiler.
The text was updated successfully, but these errors were encountered: