Skip to content

/events/past: 33 queries and ~466ms median per render #2887

Description

@mroderick

Summary

EventsController#past has a median duration of 466ms (max 17.3s) with 33 queries per render (median db_runtime 80ms, view_runtime 118ms). The action already sets an ETag via fresh_when, but non-conditional clients still pay the full render.

Code path: EventsController#pastfetch_past_eventspaginated_events (a UNION ALL across Workshops, Meetings, Events) → load_eventsEventPresenter.decorate_collection.

Measured

3h window on 2026-09-16/17: 127 requests, median 466ms, max 17.3s. Stale by the time you read this — re-measure before starting (see #2885's dashboard or the homelab drain archive).

Suggested directions

  1. Capture the 33 queries locally (Bullet or Prosopite against a production dump) — likely per-event loads missing includes (sponsors, invitations, chapters)
  2. Batch the per-event loads into the UNION ALL or a single preload
  3. The page already has per-event fragments in Solid Cache (event_card_component/* keys) — check hit rate before adding more caching

Verify

Query count and median duration drop; ETag behaviour unchanged.

Related: #2885

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

    performancePerformance issues and optimizations

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions