Skip to content

arena: migrate every arena-shaped RPC (LS nav payloads + remaining query classes) #12

Description

@johnsoncodehk

Context

The V8-arena transport landed for the hot query path (bb4fef2 — 32 query classes, plus getContextualTypeForArgumentAtIndex in 505aed9). Measured on the 1000-file type-aware ESLint corpus: rpc clock 3.4s → 2.65s, heap 1.34GB → 0.90GB, call count unchanged (transport-only).

Principle (maintainer): everything that should be on the arena goes on it. Coverage is decided by payload shape (small fixed-shape records / arrays of them), not by measured frequency alone.

Candidates

  1. LS navigation payloads (the editor-latency surface — the product's main path):
    • references / FAR — location arrays (fixed file/line/offset triples; natural arena shape)
    • definitionAndBoundSpan — location records
    • quickinfo — display strings (internable)
    • getCompletionsAtPosition, getSignatureHelp, getRenameInfo/getEditsForRename, getSymbolsDeclarations, getAmbientModules
    • Inner type/symbol queries on this path already ride the arena; these are the outer payloads. Frequency needs a tsserver-path profile (sim-nav / volar workload) to prioritize.
  2. Remaining query classes still on JSON — audit the bridge dispatch for record-shaped results not yet covered (relation getters beyond the current table, getContextualTypeForJsxAttribute, etc.).

Explicit non-goals (shape already optimal)

  • updateSnapshot params/results — large documents, V8 native JSON wins (msgpack experiment, reverted)
  • diagnostics with nested related-information (document payloads, low frequency — revisit only if editor-path measurement says otherwise)
  • getSourceFile blobs — already zero-serialization by design (raw binary, 1 memcpy, Electron-sandbox floor)

Work items

  • tsserver-path profile (sim-nav/volar): frequency + payload volume per LS method, to order the migration
  • Migrate LS nav payloads to arena (record schemas per method, arrays of location records, interned display strings)
  • Audit + migrate any remaining record-shaped query classes
  • Per-method coverage in tools/triage-arena-parity.mjs; triage-electron-abi.mjs differential coverage for every new method
  • Gates: check:lib/enums/sourcefile-guard, crossgen, sim-edit, sim-xfile, sim-nav (no new divergences), volar 205/205

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions