Skip to content

perf: try to reduce ping overhead#39

Open
SukkaW wants to merge 2 commits intoXGHeaven:masterfrom
SukkaW:reduce-ping-overhead
Open

perf: try to reduce ping overhead#39
SukkaW wants to merge 2 commits intoXGHeaven:masterfrom
SukkaW:reduce-ping-overhead

Conversation

@SukkaW
Copy link

@SukkaW SukkaW commented Oct 25, 2025

The PR changes two things:

  • /ping now also supports HEAD request, and it will respond with HTTP 204 with an empty response body
  • The front-end now uses HEAD requests. And instead of using json() (which has JSON parse overhead) new implementation uses arrayBuffer()
    • Technically, we don't have to consume the body, but on some browsers (namely Safari), this would cause memory leaks (just like on Node.js). But since we return an empty response from the server, this should not cause any performance overhead anyway.
    • Also, with the PR, it now calculates the RTT before consuming the body.

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.

1 participant