Skip to content

The per-fetch hold timer adds about 0.16 µs to each cache miss #4396

Open

Description

@ldt1996

#4366 arms one timer per source fetch on a cache miss, so the fetch that holds a record's lock releases it at the 10-second limit even if it never settles. That adds a setTimeout, unref and clearTimeout to every cold miss.

Measured on 20,000 gets against an immediate source (five interleaved runs, median per get): 22.09 µs on main, 22.25 µs with #4366, about 0.16 µs (0.7%) per cold miss.

Possible changes if that cost matters on a hot miss path: one sweep timer per table that releases expired holds, or arm the timer only once a second request is waiting on the record.

Review-Deferral: 704563555e5f372e severity=nit category=performance

🤖 Generated by Claude Opus 5.5 (Claude Code); posted via @ldt1996.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    P3

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions