-
-
Notifications
You must be signed in to change notification settings - Fork 774
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
Add experiment to produce precompiled builds of serde_derive #2514
Conversation
Expansion time benchmarkI tested against https://github.com/dtolnay/clang-ast/blob/0.1.19/tests/exhaustive.rs to quantify the overhead of process spawning and serialization. That integration test contains 286 calls to [dev-dependencies]
-serde_derive = "1.0.171"
+serde_derive-x86_64-unknown-linux-gnu = "1.0.171-alpha.1" Here is the command I measured: $ time cargo expand --ugly --test exhaustive >expand.rs On my machine, the macro expansion takes 1.06 seconds with That is about 3 milliseconds per macro call. |
Interesting. Could you explain, what is improved, because in you last comment there is slowdown!? Some statistics also would be interesting. |
That specifically only measures macro expansion. Overall build time for serde_derive goes from 9.2 seconds to 0.8 seconds (at |
@dtolnay, if this feature will be ever re-enabled, then, please, don't use Cosmopolitan. Cosmopolitan is just a hack. It has a lot of problems:
Overall, this is very hacky solution for a non-problem (i. e. what is wrong with just creating some amount of separate binaries?) |
|
||
let mut trees = Vec::new(); | ||
while !buf.is_empty() { | ||
match match buf.read_u8() { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
I'm preemptively locking this PR. Please open new issues instead of commenting on merged PRs |
If this works, it needs to be productionized further using any of the following techniques:
[target.x86_64-unknown-linux-gnu.dependencies]
to make the macro forward to a different crate on different targets