Skip to content
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 compile time #586

Merged
merged 9 commits into from
Dec 27, 2022
Merged

Reduce compile time #586

merged 9 commits into from
Dec 27, 2022

Conversation

bjorn3
Copy link
Contributor

@bjorn3 bjorn3 commented Dec 6, 2022

The commits are mostly independent, so if you think any of the commits is bad for maintainability, I can easily drop it. The commits I'm most confident about are:

  • 4977978 "Remove futures dependencies from wayland-client"
  • 84aad31 "Reduce code bloat of smallvec![] macro"

@codecov
Copy link

codecov bot commented Dec 6, 2022

Codecov Report

Base: 75.34% // Head: 74.29% // Decreases project coverage by -1.04% ⚠️

Coverage data is based on head (e7a022f) compared to base (a9cb9f1).
Patch coverage: 36.53% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #586      +/-   ##
==========================================
- Coverage   75.34%   74.29%   -1.05%     
==========================================
  Files          52       53       +1     
  Lines        7341     7564     +223     
==========================================
+ Hits         5531     5620      +89     
- Misses       1810     1944     +134     
Flag Coverage Δ
main 59.09% <36.53%> (-0.99%) ⬇️
test-- 78.34% <37.25%> (-2.37%) ⬇️
test--server_system 61.92% <37.25%> (-0.76%) ⬇️
test-client_system- 69.27% <37.25%> (-1.58%) ⬇️
test-client_system-server_system 51.83% <37.25%> (-0.54%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
wayland-backend/src/protocol.rs 81.39% <ø> (ø)
wayland-client/src/conn.rs 86.17% <0.00%> (-4.42%) ⬇️
wayland-client/src/globals.rs 75.91% <0.00%> (-14.53%) ⬇️
wayland-client/src/lib.rs 4.76% <0.00%> (-2.65%) ⬇️
wayland-egl/src/lib.rs 1.66% <0.00%> (-0.16%) ⬇️
wayland-server/src/lib.rs 13.63% <0.00%> (-2.58%) ⬇️
wayland-server/src/socket.rs 47.61% <0.00%> (-9.53%) ⬇️
wayland-scanner/src/token.rs 29.32% <29.32%> (ø)
wayland-scanner/src/common.rs 95.74% <96.36%> (+0.18%) ⬆️
wayland-scanner/src/lib.rs 83.33% <100.00%> (ø)
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@elinorbgr elinorbgr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small thing, otherwise LGTM thanks 👍

Looks like the CI failure is from calloop, which uses thiserror as well and apparently does not specify its minimal version correctly.

wayland-scanner/src/lib.rs Outdated Show resolved Hide resolved
And turn futures-channel into a dev-dependency as it is only used by a
doc test.
Together with it's syn dependency thiserror takes a non-trivial amount
of time to compile.

The manual implementations are cleaned up versions of what was
previously derived using thiserror.
The only thing syn is used for is parsing string literals. The copied
code is about 160 lines.
Previously the smallvec![] macro would check if the elements fit in the
inline capacity and generate code to handle both cases. By lifting the
check out into wayland-scanner, rustc has to typeck and borrowck less
code.

This saves about 300ms of building wayland-protocols with all client
features.
This makes the code a bit easier and ensures at compile time that the
child_spec is never overwritten
This reduces the amount of SmallVec::into_iter and SmallVec::drop calls.
@bjorn3
Copy link
Contributor Author

bjorn3 commented Dec 19, 2022

Rebased

@elinorbgr elinorbgr merged commit 4ba7fbf into Smithay:master Dec 27, 2022
@bjorn3 bjorn3 deleted the less_deps branch December 27, 2022 18:01
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