Skip to content

perf(dpdk): reduce pending socket scans and per-completion vector compaction #35

Open

Description

@thweetkomputer

Follow-up to #33 (worker-owned shared-ring progression and sleep coordination). This is a source-based optimization opportunity, not a measured performance result.

Current behavior

DpdkBackend::Impl::SocketCompletions() scans pending connects, accepts, sends, reads, and disconnects on each poll. Non-ready requests repeatedly return EAGAIN. Completed entries are erased individually from vectors, shifting the remaining entries; retiring a large batch can cause quadratic aggregate movement.

Proposed work

  1. Replace repeated middle erases with stable batch compaction or another representation that preserves required ordering and ownership. Audit completion callbacks, reentrant submissions/cancellations, and socket-slot pins before choosing a representation.
  2. Evaluate readiness-driven processing to avoid scanning inactive sockets. Treat this as a separate, larger substep requiring a FreeBSD notification/lifecycle design; batch compaction can land independently.

Acceptance

  • Benchmark many idle connections, many pending reads/writes, and batches where many requests complete together.
  • Record request visits, element movement/allocation, instructions per completion, throughput, and p99.
  • Test mixed ready/non-ready requests, partial writes, EAGAIN, cancellation, close/handle reuse, and callback reentry.
  • Preserve per-operation completion semantics, fairness, and ownership through terminal callbacks. Do not reorder requests without proving the relevant contract permits it.
  • State whether only compaction or also readiness-driven scheduling is implemented; the latter is not a prerequisite for the first improvement.

Benchmark reports should identify the tested revision/build and compare instructions, cycles, throughput, and p99 latency where relevant. Record only non-default settings after checking the tested version's defaults. Preserve notification preparation/recheck/cleanup, mailbox wake_seq, DPDK parked handshakes, and pending-I/O sleep vetoes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions