softprops / hyperlocal

🔌 ✨rustlang hyper bindings for local unix domain sockets
MIT License
227 stars 46 forks source link

Dependency segmentation #54

Closed onalante-msft closed 2 years ago

onalante-msft commented 2 years ago

This PR is technically comprised of three changes. Since the changes are small individually, they are bundled together here. I can split the changes into separate PRs if that is preferred.

The main motivation of this PR is to segment hyper's server and client features into hyperlocal's server and client features. This helps reduce compile times for dependents only needing one of the features. To further reduce compile times, this PR also exchanges pin-project for pin-project-lite and removes the futures-util dependency: pin-project-lite is used over pin-project in tokio, and Rust std::future is now standard enough to accomplish what is included from futures-util.

Some basic timings (cargo clean before each run): command base change
cargo build --no-default-features --features=client 18.04s 15.58s
cargo build --no-default-features --features=server 17.84s 15.32s
cargo build --all-features 18.88s 16.19s
softprops commented 2 years ago

Excellent and thank you!

onalante-msft commented 2 years ago

Sorry, I did not push a formatting commit. I will open another PR to fix the formatting errors ASAP. It will also include some documentation updates and clippy checks.

edmorley commented 2 years ago

@softprops Hi! I don't suppose you know when you might have a spare moment to look at #58 / #57 so a new version of hyperlocal can be published with this change? I'm hoping to use this with bollard to reduce its footprint. Many thanks :-)