http-rs / http-rs/surf

why is surf::get() slow?

Open
#143 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.5k
Forks
128
PR merge metrics
No merged PRs in 30d

Description

I tried surf/examples/hello_world.rs,and found it toke at least 1 second.

https://httpbin.org/get
● sending request
/home/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/surf-1.0.3/src/middleware/logger/native.rs:119
› req.id: 0
› req.method: "GET"
› req.uri: "https://httpbin.org/get"

● request completed
/home/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/surf-1.0.3/src/middleware/logger/native.rs:119
› req.id: 0
› req.status: 200
› elapsed: "1.187788349s"

then, I changed uri to some local url, surf also toke at least 1 second.
but, when access these local url using wget/curl, it only toke 10 millisecond.

why is surf::get() is so slow ?

Contributor guide

Open the contributing guide

Research direction

Reproduce the delay with surf/examples/hello_world.rs and the reported local and httpbin.org URLs, then inspect the request timing output from middleware/logger/native.rs:119. Compare the surf::get() behavior with wget/curl and identify the source of the roughly one-second delay; completion requires a confirmed cause and an appropriate fix or explanation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.