Skip to content

benchmarks-website: collapse N+1 group-charts discovery into one query #7812

@connortsui20

Description

@connortsui20

benchmarks-website/server/src/api/charts.rs::collect_group_charts re-runs the entire collect_groups discovery pass per call before fetching each chart, which makes the landing-page render O(groups * charts_per_group) DB queries plus the discovery scan.

Fine for the current dataset; revisit when chart counts grow or the cold-page render starts feeling slow.

Sketch of the fix:

  • Walk the fact tables once per page render.
  • Materialize (group_key, chart_links, chart_payloads) in a single pass keyed by group_key, so the chart-card collection no longer needs the discovery pass.
  • Or: take a Vec<ChartLink> directly from the caller (the landing-page handler already has them) and skip the discovery rerun.

This is a pure performance refactor; the wire format stays identical.

See the doc comment on collect_group_charts in
benchmarks-website/server/src/api/charts.rs for the existing breadcrumb.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions