Skip to content

Attribute the served read floor (~0.2 s server-side on a trivial read) and expose it as usage #752

Description

@ragnorc

Measurement

Call Wall time, 3 runs
GET /healthz (round trip only) 0.10 s, 0.11 s, 0.18 s
omnigraph snapshot --json (metadata only) 0.66 s, 0.58 s, 0.57 s
query -e 'match { $p: Person } return { $p.slug } limit 1' 0.36 s, 0.34 s, 0.36 s
query -e 'match { $p: Person } return { count($p) as n }' (4,678 rows) 0.45 s, 0.35 s, 0.35 s
keyed lookup Person { slug: $s } 0.42 s, 0.39 s, 0.38 s
omnigraph version (CLI startup) 0.01 s

So a trivial served read costs about 0.35 s, of which 0.10–0.15 s is the round trip. The remaining ~0.2 s is server-side and unattributed. It is not manifest reloading: the warm-read contract (crates/omnigraph/tests/warm_read_cost.rs, since v0.7.1 #268) makes a warm same-branch read zero __manifest reads and one version probe. snapshot being slower than a query is itself unexplained.

For the agent workload (many small calls per task) this fixed floor outranks any plan choice; RFC 0047 (#791) makes this rollout step 7.

Ask

  1. Attribute the floor per phase on the server: auth/token verification, settings resolution, version probe (object-store round trips and their latency from the serving region), compile-cache hit, table open by location+version, the scan itself, result encoding. The existing helpers::cost object-store counters and warm_read_cost.rs give the request counts; wall time per phase needs a tracing span or the additive usage object RFC 0047 (rfc: RFC 0047, search plan truth on engine v2 #791) proposes, which reports time per phase (authentication, target resolution, compilation, planning, execution, serialization).
  2. Explain why snapshot costs ~0.6 s when a query costs ~0.35 s.
  3. Cut what the attribution shows, in order of size. Caching of immutable version-pinned state is invariant-12-clean if that is where the time is; a second version probe or a per-request policy/token round trip would be a different fix.

Acceptance

A trivial served read's server-side time is reported per phase in the response (or a tracing export), and a cost test pins the object-store request count of that read at its current value so the floor cannot regress silently.

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

    P-mediumMedium priorityacceptedTriaged and validated; open for a PRfeatureFeature proposalperformanceCorrect result, wrong cost: work scales with the table, not with the delta or the query

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions