Migrate serve command to hyper 0.13 #904
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in #782, hyper is already included in Zola due to the reqwest dependency (used in the
link_checker
andtemplates
components). Replacing Actix with hyper in the serve command reduces the number of dependencies and slightly improves build times and binary size.Preliminary numbers on my system (macOS 10.15) are as follows:
These numbers depend on your hardware and operating system but it gives you a relative idea of the improvements here. Some of the changes are modest but they don't come with any cost, so it seems like an easy win.
This is currently based on the reqwest 0.10 draft PR (#892) and I'll rebase this when reqwest 0.10 is released and that PR is merged. I wanted to get this up as a draft in the interim time, so folks can review it and we can address any implementation issues beforehand. Feel free to check out the branch, build it, and run it locally to see if you encounter any issues on your system (as I've only tested this on macOS).