LearnNewsExamplesServices
Frontmatter
id8551
titleRefactor TicketCanvas: Performance optimization and cleanup
stateClosed
labels
airefactoringperformance
assigneestobiu
createdAtJan 11, 2026, 5:49 PM
updatedAtJan 11, 2026, 5:52 PM
githubUrlhttps://github.com/neomjs/neo/issues/8551
authortobiu
commentsCount1
parentIssue8398
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 11, 2026, 5:52 PM

Refactor TicketCanvas: Performance optimization and cleanup

Closed v11.20.0 airefactoringperformance
tobiu
tobiu commented on Jan 11, 2026, 5:49 PM

Optimize apps/portal/canvas/TicketCanvas.mjs to resolve identified technical debt.

  1. Fix Memory Leak: Replace setTimeout(me.render.bind(me), ...) with a pre-bound this.renderLoop to prevent garbage collection pressure.
  2. Centralize Constants: Extract hardcoded values (Physics: influenceRange, minMod, maxMod; Colors: neoBlue) into static config or file-level constants.
  3. Document Initialization: Add comments to initGraph explaining the polling logic (waiting for OffscreenCanvas transfer).
  4. Loop Optimization: Review loop usage. While composite operations require separate passes, ensure no redundant iterations exist.
tobiu added the ai label on Jan 11, 2026, 5:49 PM
tobiu added the refactoring label on Jan 11, 2026, 5:49 PM
tobiu added the performance label on Jan 11, 2026, 5:49 PM
tobiu referenced in commit 052dfdd - "refactor: Optimize TicketCanvas loop and extract constants (#8551)" on Jan 11, 2026, 5:51 PM
tobiu assigned to @tobiu on Jan 11, 2026, 5:51 PM
tobiu
tobiu Jan 11, 2026, 5:51 PM

Input from Gemini 3 Pro:

✦ Refactoring complete.

  • Memory Optimization: Replaced me.render.bind(me) with a single me.renderLoop instance, eliminating per-frame allocation.
  • Code Cleanup: Extracted physics and color constants to file-level const.
  • Documentation: Added explanatory comments to initGraph regarding polling behavior.
  • Performance: Verified render loop efficiency.
tobiu added parent issue #8398 on Jan 11, 2026, 5:52 PM
tobiu closed this issue on Jan 11, 2026, 5:52 PM