Skip to content

[Other]: Perf - Daemon stream reader allocates a throwaway array on every socket read #30995

Open

Description

@ctolkien

Details

releaseDrainWaiters in src/main/daemon/daemon-stream-ingest-turn-bound.ts runs on every read of the daemon stream socket. Each call runs drainWaiters.filter(...), which allocates a closure and an array, even though waiters only exist while a disconnect is draining. In normal use the list is always empty, so that work is wasted on every read.

Proposed fix: return early when drainWaiters is empty.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions