Monorepo for Tangled tangled.org

appview/repo: reuse knotmirror http client #4309

Merged oppi.li
targeting master from nathanbeddoe.com/core:add-persistent-http-client
Merged opened by and assigned to oppi.li
targeting master from nathanbeddoe.com/core:add-persistent-http-client

Overview #

The standard indigoxrpc.Client doesn't maintain a persistent HTTP Client unless defined in it's constructor. This PR changes it to use a persistent client to prevent TLS re-negotiation with the knot mirror.

Benchmark #

Ten hot requests after one warm-up against http://localhost:3000/tangled.org/core/, with Appview using the public KnotMirror.

Version Mean TTFB Median TTFB Range Improvement
Fresh XRPC HTTP client/transport per request 638 ms 634 ms 600–696 ms —
Stored XRPC client with persistent HTTP transport 356 ms 343 ms 300–509 ms 44% lower mean / 46% lower median

The persistent-client version was approximately 1.8× faster on this hot path.

Disclaimer #

This PR was generated with the assistance of Codex, but all changes had developer oversight. Take the benchmark with a grain of salt.

Signed-off-by: Nathan Beddoe nbedd2@protonmail.com

Commits 0