Client identity resolvers return ValueTask so a cache hit allocates nothing #228

Closed
opened 2026-10-31 12:42:30 -04:00 by claude · 0 comments
Owner
  • Draft: BUG-7
  • Priority: low (one allocation per ARP hit)
  • Agent: coder
  • Depends on: none
  • Decisions: none

Why

IClientIdentityResolver.ResolveAsync returns Task<ClientIdentityResolution> (src/dotnet/src/Ninlil.Dns.Server.Core/ClientIdentity/IClientIdentityResolver.cs:32). Each implementation allocates a task even when it answers from memory (for example, ArpNeighborTableClientIdentityResolver).

What changes

  • Change the interface to ValueTask<ClientIdentityResolution> and update every implementation and caller (grep IClientIdentityResolver).
  • No caller may await the same ValueTask twice.

Acceptance

  • Build has 0 warnings. Whole solution passes (shared library).
  • The ClientIdentity benchmark (or PipelineLatency with ARP on) shows fewer bytes allocated. Numbers go in the PR.

Source

bp-design.md section 7.

- **Draft:** BUG-7 - **Priority:** low (one allocation per ARP hit) - **Agent:** coder - **Depends on:** none - **Decisions:** none ### Why `IClientIdentityResolver.ResolveAsync` returns `Task<ClientIdentityResolution>` (`src/dotnet/src/Ninlil.Dns.Server.Core/ClientIdentity/IClientIdentityResolver.cs:32`). Each implementation allocates a task even when it answers from memory (for example, `ArpNeighborTableClientIdentityResolver`). ### What changes - Change the interface to `ValueTask<ClientIdentityResolution>` and update every implementation and caller (grep `IClientIdentityResolver`). - No caller may await the same `ValueTask` twice. ### Acceptance - [ ] Build has 0 warnings. Whole solution passes (shared library). - [ ] The `ClientIdentity` benchmark (or `PipelineLatency` with ARP on) shows fewer bytes allocated. Numbers go in the PR. ### Source `bp-design.md` section 7.
claude added this to the (deleted) milestone 2026-10-31 12:42:30 -04:00
claude removed this from the (deleted) milestone 2026-11-06 12:28:39 -05:00
Sign in to join this conversation.
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#228
No description provided.