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

Migrate serve command to hyper 0.13 #904

Merged
merged 1 commit into from
Dec 31, 2019
Merged

Conversation

samford
Copy link
Contributor

@samford samford commented Dec 26, 2019

As discussed in #782, hyper is already included in Zola due to the reqwest dependency (used in the link_checker and templates 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:

Actix 1.0 hyper 0.13 Change
Build Items 411 334 -23%
Build Time (debug) 2m 44s 2m 11s -25%
Build Time (release) 9m 16s 8m 16s -12%
Binary (debug) 87.4 MB 77.1 MB -13%
Binary (release) 17.3 MB 16.4 MB -5%
Binary (release, strip) 15.8 MB 15 MB -5%

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).

@Keats
Copy link
Collaborator

Keats commented Dec 27, 2019

Very nice, I'll merge it when reqwest 0.10 is released!

@samford
Copy link
Contributor Author

samford commented Dec 31, 2019

This has been rebased on the reqwest v0.10 release PR, so it should be good.

As mentioned in the reqwest v0.10 PR, the site component's check_site test is still intermittently hanging until it times out. It's a coin toss as to whether it will manifest when the tests are run and, unfortunately, it appeared in this run (on linux-1.39). I can confirm that it also happens on my local setup sometimes, so it's not just CI.

@samford samford marked this pull request as ready for review December 31, 2019 00:42
@Keats
Copy link
Collaborator

Keats commented Dec 31, 2019

@samford Can you rebase?

hyper is already included in Zola due to the reqwest dependency (used
in the link_checker and templates components). Replacing Actix with
hyper in the serve command reduces the number of dependencies and
slightly improves build times and binary size.
@samford
Copy link
Contributor Author

samford commented Dec 31, 2019

Rebased on the current next branch now.

@Keats
Copy link
Collaborator

Keats commented Dec 31, 2019

I've tried it locally and it works well, thanks a lot for that. The build time change is really noticeable!

@Keats Keats merged commit 9eefa02 into getzola:next Dec 31, 2019
@samford samford deleted the hyper-serve branch December 31, 2019 15:23
Keats pushed a commit that referenced this pull request Feb 3, 2020
hyper is already included in Zola due to the reqwest dependency (used
in the link_checker and templates components). Replacing Actix with
hyper in the serve command reduces the number of dependencies and
slightly improves build times and binary size.
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