[Bug] Inaccurate response time measurement
- Dominant language
- TypeScript
- Stars
- 40k
- Forks
- 2.4k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 61
Description
I'm currently using Insomnia to debug a performance issue in my API, and noticed that the response time measurement is quite inaccurate. In particular, it appears like some kind of rounding in the order of ~15 ms is performed, and additionally that the response time is missing altogether sometimes (which may or may not be related).
My observations are as follows:
1) When pinging the server, the roundtrip to the server is stable at 11-12 ms, with the occasional arbitrarily slower result. This seems reasonable.
2) When repeatedly calling the endpoint through Chrome, the response time is stable around 16-17 ms, with the occasional arbitrarily slower result. This also seems reasonable, considering the additional overhead of HTTPS, the webserver, the API code, ...
3) When repeatedly calling the endpoint through Insomnia, the response time is stable around 15-16 ms, but occasionally is either **0 ms** or **31 ms**. Never 1-14 ms, and never 17-30 ms. This does not seem reasonable. **0 ms** should be impossible given the 11-12 ms roundtrip to the server. Considering the **31 ms** results as well, it seems like there is some kind of rounding in the order of ~15 ms going on.
Contributor guide
Research direction
Start by reproducing the reported measurements in Insomnia against an endpoint with a known 11–12 ms round trip, then compare repeated results with Chrome and ping. Trace the response-time measurement entry point and determine why values are missing or cluster at 0 ms and 31 ms. Done means elapsed times are consistently reported without the observed coarse rounding.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, typescript
- Domain
- api, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100