Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Chapter show pages allocate ~21k+ objects per render for large chapters (18% of app allocations)

未关闭
#2,952 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
rails, ruby

调研方向

Start with ChapterController#show and re-measure current 200 responses in the allocations panel or Codebar requests dashboard. Compare the eager-load sets and the shared/sponsors, members/organisers_grid, and shared/newsletter partials, noting that EventCardComponent already fragment-caches. Done means materially lower payload.allocations for 200 responses with subscription forms unchanged for logged-in members.

由索引模型根据 Issue 内容生成。

描述

performance

Issue 2952: Chapter show pages allocate ~21k+ objects per render for large chapters (18% of app allocations)

Summary

ChapterController#show successful renders cost p50 20,880 allocations, p95 70,806 (max 438k) with 15-20 queries per request — 131.7M allocations (18% of app total) over the last 7 days from 4,308 renders. Large-chapter pages (London-style: many upcoming workshops/events) rebuild all public content per view. The 404-probe tail is already handled (#2891/#2907) and is out of scope here: ~1% of allocations.

Measured

7-day window 2026-09-21..27 (canonical logs): 131.7M allocations from 4,308 x 200s; p50 20,880, p95 70,806, max 437,968; 15 queries median, 20 at p95; view p50 11ms. Cost is driven by the controller's eager_load sets (sponsors, organisers, permissions, workshop_host for workshops; venue, sponsors, sponsorships, permissions, organisers for events) plus per-render partials (shared/sponsors, members/organisers_grid, shared/newsletter). Re-measure from current logs or the Codebar requests dashboard (allocations panel) before starting.

The page is public and mostly static. EventCardComponent already fragment-caches itself (used for the event cards); the sponsors and organisers sections do not.

Suggested directions

  1. HTTP caching for anonymous GETs — fresh_when keyed on [chapter.cache_key_with_version, latest workshop/event cache_key], gated on !logged_in? (the subscriptions partial is per-user).
  2. Fragment-cache the sponsors and organisers sections on the chapter cache key.
  3. Review the double eager-load sets — up to 20 queries on a cache-cold render suggests some loads are unused by the rendered page.

Verify

payload.allocations p50 for ChapterController#show (200s) drops materially on the allocations panel; no regression for logged-in members (subscription form renders as before).

Related: #2891, #2887, #2888 (same measurement method)

主要语言
Ruby
星标
104
派生
205
平均合并
1 天 2 小时
30 天内合并 PR
77

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

codebar/planner 的其他 Issue

查看 codebar/planner 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。