Replies: 1 comment 3 replies
|
Hard to say, some thoughts:
Possibly other things. Generally reqwest is extremely fast, so could be network or other things. |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I have tried reqwest out, but I seem to be getting wildly inconsistent performances between runs. The response time seems to vary usually between ~360ms-1200ms (which by itself is a lot), occasionally [although rarely, idk, ~1/100?] reaching values as high as 11s (this is weird; I have tried multiple servers and networks).
There doesn't seem to be much of a difference whether or not I use the short call once, twice, or a client once/twice (ie to eliminate DNS lookups and whatever). Oftentimes, with the same request performed twice on the same client sequentially, the first would take ~500ms and the later ~900ms. Below is the rust code I used:
I can't seem to find an explanation for this. For reference, I performed the same test with JS/Bun, with this code:
and I am getting pretty consistently 350 ± 10ms, with occasional spikes of ~850ms (~ 1/50).
I find this slightly concerning, and was wondering whether someone could shine a light on:
a) why the inconsistency
b) how come JS fetch is faster?
c) what I could do to get similar results to the JS/Bun example
Thank you!
All reactions