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

Simplifying the dependency tree #195

Open
emilk opened this issue Oct 22, 2024 · 7 comments
Open

Simplifying the dependency tree #195

emilk opened this issue Oct 22, 2024 · 7 comments

Comments

@emilk
Copy link
Contributor

emilk commented Oct 22, 2024

Hello, and thanks for an awesome crate!

I'm interested in replacing the use of reqwest with ehttp.

The advantage is a lot less dependencies. reqwest brings in a huge tree of dependencies, including tokio, while ehttp depends only on the minimal ureq. This in turn translates to faster compile times and smaller binaries.

Would you be open to a PR making such a change?

@podusowski
Copy link
Owner

Hi Emil, thanks!

Sounds interesting, but last time when I was choosing between two, ehttp didn't support multiple downloads, not sure if that changed? Also, walkers do HTTP cache though http-cache. But if these are addressed, I see no reason not to accept it.

@emilk
Copy link
Contributor Author

emilk commented Oct 23, 2024

Awesome! Yeah, it will require some work for sure.

What do you mean by "support multiple downloads" though? Downloading multiple files in a single HTTP GET?

@abey79
Copy link
Contributor

abey79 commented Oct 23, 2024

A possible avenue might be to split the tile download/cache part from the rendering part, and make the former optionally swappable by a custom implementation.

@jprochazk
Copy link

I believe this issue would be a prerequisite to using ehttp in this crate:

@podusowski
Copy link
Owner

Downloading multiple files in a single HTTP GET?

Multiple connections. There's a test for it. It's ridiculously slow without it.

@jprochazk
Copy link

Hey, I'm currently working on this. The plan is to completely replace reqwest with ehttp, meaning without retaining support for reqwest, tokio, etc., and replacing all async code with equivalent sync code, using threads where needed. Does that sound reasonable?

@podusowski
Copy link
Owner

using threads where needed.

Well, it's probably a good idea to run io on a separate thread, but walkers have 6 parallel download streams/connections. Starting 6 threads would be a too much bloat in my opinion, so ehttp/ureq would need to support io multiplexing (e.g. via mio).

Unless @emilk and @abey79 are fine with this, then we could put it behind a feature or something.

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

No branches or pull requests

4 participants