A DNSCrypt-over-TCP benchmark measures the transport like the other transports #468

Merged
claude merged 2 commits from feature/226-dnscrypt-tcp-benchmark into develop 2026-11-14 11:35:38 -05:00
Owner

Closes #226

A benchmark class for DNSCrypt over TCP joins the transport benchmarks, and the DNSCrypt benchmarks share one helper for the resolver identity, the certificate services and the stamp.

What one invocation measures. DNSCrypt over TCP is one transaction per connection: the listener closes after the first answer, so there is no pipelined case as plain TCP has. Two methods, mean per operation:

  • Query_WithCertificateAlreadyKnown: one new connection, one encrypted query and its reply (comparable to the plain TCP class's OneQueryPerNewConnection).
  • Query_WithCertificateDiscovery: a connection for the certificate query, with the signature verified, then a second one for the encrypted query (the full exchange the DNSCrypt UDP class measures).

Like its siblings it uses the pipeline data set on SQLite, a fake upstream on loopback, and proves in its setup that replies are the expected ones and that 100 warm queries run zero database commands.

Run. --scale Small on a busy machine, which only proves the classes run: DNSCrypt TCP 254 µs and 373 µs per query with one client; plain TCP 80 µs per new connection. The DNSCrypt UDP class still runs after the helper was extracted.

NoDelay is set on the listener's TCP path. The client side used for upstreams is not, which is filed as #467 together with a comment that gives the wrong reason.

Build: 0 warnings. No CHANGELOG entry: a benchmark is not user-visible behaviour. CI builds the benchmark project and does not run it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

Closes #226 A benchmark class for DNSCrypt over TCP joins the transport benchmarks, and the DNSCrypt benchmarks share one helper for the resolver identity, the certificate services and the stamp. **What one invocation measures.** DNSCrypt over TCP is one transaction per connection: the listener closes after the first answer, so there is no pipelined case as plain TCP has. Two methods, mean per operation: - `Query_WithCertificateAlreadyKnown`: one new connection, one encrypted query and its reply (comparable to the plain TCP class's `OneQueryPerNewConnection`). - `Query_WithCertificateDiscovery`: a connection for the certificate query, with the signature verified, then a second one for the encrypted query (the full exchange the DNSCrypt UDP class measures). Like its siblings it uses the pipeline data set on SQLite, a fake upstream on loopback, and proves in its setup that replies are the expected ones and that 100 warm queries run zero database commands. **Run.** `--scale Small` on a busy machine, which only proves the classes run: DNSCrypt TCP 254 µs and 373 µs per query with one client; plain TCP 80 µs per new connection. The DNSCrypt UDP class still runs after the helper was extracted. `NoDelay` is set on the listener's TCP path. The client side used for upstreams is not, which is filed as #467 together with a comment that gives the wrong reason. Build: 0 warnings. No CHANGELOG entry: a benchmark is not user-visible behaviour. CI builds the benchmark project and does not run it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Refs #226

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
A DNSCrypt-over-TCP benchmark measures the transport like the other transports
All checks were successful
Build / Compute Version (pull_request) Has been skipped
Build / Test .NET on Windows (pull_request) Has been skipped
Build / Windows Test Gate (pull_request) Has been skipped
Build / Test Admin Console (pull_request) Successful in -1m14s
Build / Lint and Script Tests (pull_request) Successful in -2m2s
Build / Test .NET (pull_request) Successful in 3m53s
Build / Build Binary (linux-amd64) (pull_request) Has been skipped
Build / Build Binary (linux-arm64) (pull_request) Has been skipped
Build / Build Binary (macos-amd64) (pull_request) Has been skipped
Build / Build Binary (macos-arm64) (pull_request) Has been skipped
Build / Build Binary (windows-amd64) (pull_request) Has been skipped
Build / Build Arch Linux Packages (pull_request) Has been skipped
Build / Build and Test Deb and RPM Packages (pull_request) Has been skipped
Build / Build and Push Image (pull_request) Has been skipped
Build / Smoke Test the Windows Binary (pull_request) Has been skipped
Build / Stage Draft Release (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (common) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Has been skipped
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Has been skipped
Build / Publish Release (pull_request) Has been skipped
Build / Pipeline (pull_request) Successful in 0s
c58750d612
Closes #226

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit 3315d12668 into develop 2026-11-14 11:35:38 -05:00
claude deleted branch feature/226-dnscrypt-tcp-benchmark 2026-11-14 11:35:39 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil!468
No description provided.