Skip to content

Conversation

CryZe
Copy link
Contributor

@CryZe CryZe commented Sep 10, 2025

This massively improves compile times by not forcing serde to depend on serde_derive. This allows many crates to start compiling much sooner, which ends up resulting in often quite massive compile time wins for real world projects.

In my case this PR reduced the build times of my project (clean, release) from 91.4s to 76.0s.

This massively improves compile times by not forcing `serde` to depend
on `serde_derive`. This allows many crates to start compiling much
sooner, which ends up resulting in often quite massive compile time wins
for real world projects.
@CryZe
Copy link
Contributor Author

CryZe commented Sep 10, 2025

Arguably the entire derive dependency could be removed by replacing it with manual implementations, but it probably almost never would improve compile times as it would only impact how soon the url crate itself can finish compiling, but serde_derive is not on the url crate's critical path (and instead the massive idna chain is).

@CryZe
Copy link
Contributor Author

CryZe commented Sep 10, 2025

Seems like #1071 is related, as that bug is the only reason why serde (and transitively serde_derive) are even being pulled in.

Copy link

codecov bot commented Sep 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@0afccc9). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1075   +/-   ##
=======================================
  Coverage        ?   82.54%           
=======================================
  Files           ?       24           
  Lines           ?     4244           
  Branches        ?        0           
=======================================
  Hits            ?     3503           
  Misses          ?      741           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CryZe
Copy link
Contributor Author

CryZe commented Sep 10, 2025

Seems like the CI error is unrelated.

@Manishearth Manishearth added this pull request to the merge queue Sep 10, 2025
Merged via the queue into servo:main with commit 22b925f Sep 10, 2025
16 of 18 checks passed
@CryZe CryZe deleted the derive-compile-time-speed branch September 10, 2025 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants