livepeer / livepeer/subgraph

Add CI and local tooling to measure subgraph size and indexing performance

Open
#239 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

devex enhancement Feature
Dominant language
TypeScript
Stars
5
Forks
7
Avg merge
4h 1m
Merged PRs (30d)
6

Description

Problem

We have no repeatable way to measure subgraph size and indexing performance. That means we cannot tell whether a change improves or regresses performance, or by how much. This matters most right now for the cumulative factor stake and earnings feature (livepeer/subgraph#238, PR livepeer/subgraph#217), where we want confidence it is implemented efficiently before merging. As the subgraph grows with new data, indexing cost and size need to be guarded continuously.

Proposed solution

Add tooling, runnable both locally and in CI, that measures:

  • Subgraph manifest and build size, and entity counts
  • Indexing and sync performance against a fixed block range
  • Per mapping or per handler cost where feasible

Surface the results in CI on pull requests so size and performance deltas are visible before merge, and capture a baseline on the current subgraph for comparison.

Scope

  • Local script to measure size and indexing performance against a fixed range
  • CI workflow that runs the measurement on pull requests and reports the delta
  • A baseline captured on the current subgraph

Out of scope

  • Fixing the performance issues themselves, tracked under the audit in #179
  • Feature work, tracked in livepeer/subgraph#238

Why now

This gates merging the stake and earnings indexing feature (livepeer/subgraph#238, PR livepeer/subgraph#217) with confidence that it is efficient, and it lets us verify the pre feature performance improvements tracked in #179.

Related

  • Audit and pre feature improvements: #179
  • Feature this protects: livepeer/subgraph#238, PR livepeer/subgraph#217
  • Example performance issue to verify against: #180

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the proposed local measurement script and CI workflow, using a fixed block range to establish the current-subgraph baseline for manifest/build size, entity counts, and indexing or sync performance. Done means the measurements run locally and on pull requests, report deltas, and capture the baseline; per-mapping costs are included where feasible.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ci-cd, performance, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.