Runner sun, Snake bonus star and Stack previews allocate every frame
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- game-dev, performance
Hướng nghiên cứu
Read the render paths in games/runner/scenes/GameScene.ts and games/snake/scenes/GameScene.ts, then inspect drawMini in games/stack/scenes/GameScene.ts. Compare the per-frame allocations with the suggested caching or reuse approaches in the issue. Run npm test and use npm run dev to check the three screens; done means all three paths avoid per-frame allocations while their visuals stay unchanged.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Three render paths allocate new objects on every frame for values that do not change from frame to frame. Each one is small, but together they add steady garbage on phones.
Where
games/runner/scenes/GameScene.ts(render, the synthwave sun): each frame builds twoPhaser.Display.Colorobjects withValueToColorand interpolates a third for each of the 12 sun bands, although the band colors never change.games/snake/scenes/GameScene.ts(starPoints, called fromrenderwhile a bonus star is up): a new array of 10Phaser.Math.Vector2each frame.games/stack/scenes/GameScene.ts(drawMini): for the hold piece and every next-piece preview, each frame builds a cell array and four mapped arrays forMath.min/Math.max, although a piece type's preview layout never changes.
Details
Runner's sun, for example:
const c = Phaser.Display.Color.Interpolate.ColorWithColor(
Phaser.Display.Color.ValueToColor(NEON.yellow),
Phaser.Display.Color.ValueToColor(NEON.pink),
11,
i,
);
Impact
Low. This is extra minor-GC pressure for as long as each screen is up. It is the same class of cost as the items in #107.
Suggested fix
- Runner: compute the 12 band colors once into a module constant.
- Snake: reuse one points array and set its entries in place, or bake the star once (the rotation could then be the Image's rotation).
- Stack: cache each piece type's preview cells and offsets in a
Mapthe first time it is drawn.
Acceptance criteria
- None of the three paths allocates per frame.
- Visuals are unchanged.
Getting started
- Relevant files: the three scenes above
- How to run tests:
npm test; run a game withnpm run dev
Related: #107
Filed by repo-audit/fix-issues at b2a3ff6. Severity: low. Effort: S. audit-key: performance|games/runner/scenes/GameScene.ts|sun-colors
- Ngôn ngữ chính
- TypeScript
- Star
- 3
- Fork
- 3
- Merge trung bình
- 10 giờ 22 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TMHSDigital/GH-Arcade
-
enhancement help wanted severity: low
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
TMHSDigital/GH-Arcade#139 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted severity: medium
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
TMHSDigital/GH-Arcade#127 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted severity: medium
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
TMHSDigital/GH-Arcade#126 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add a game speed assist settingĐang mởaccessibility enhancement severity: low
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 40/100
TMHSDigital/GH-Arcade#114 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement severity: low
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
TMHSDigital/GH-Arcade#113 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TMHSDigital/GH-Arcade
Issue tương tự
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
openclaw/openclaw#203385 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nwverse/persona#12800 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoft/playwright#44289 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày