LearnNewsExamplesServices
Frontmatter
id8652
titleDocument Zero-Allocation Architecture in HeaderCanvas
stateClosed
labels
documentationai
assigneestobiu
createdAtJan 14, 2026, 8:42 PM
updatedAtJan 14, 2026, 8:45 PM
githubUrlhttps://github.com/neomjs/neo/issues/8652
authortobiu
commentsCount1
parentIssue8630
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 14, 2026, 8:45 PM

Document Zero-Allocation Architecture in HeaderCanvas

Closed v11.22.0 documentationai
tobiu
tobiu commented on Jan 14, 2026, 8:42 PM

Enhance JSDoc in apps/portal/canvas/HeaderCanvas.mjs to document the "Zero-Allocation" performance architecture.

Reason: The recent refactoring introduced advanced performance patterns (TypedArray buffers, gradient caching) that need explicit documentation to ensure future maintainers (human or AI) understand the "Why" and don't accidentally regress to object-heavy implementations.

Scope:

  1. Class Header: Add a "Performance Architecture" section detailing the Zero-Allocation strategy.
  2. waveBuffers: Document the role of Float32Array in eliminating per-frame GC.
  3. updateResources: Explain the resource lifecycle (allocation vs. reuse).
  4. calculateStrandGeometry: Clarify the method's contract: it writes to existing buffers and does not allocate new memory.
tobiu added the documentation label on Jan 14, 2026, 8:42 PM
tobiu added the ai label on Jan 14, 2026, 8:42 PM
tobiu added parent issue #8630 on Jan 14, 2026, 8:44 PM
tobiu referenced in commit 9e7c8cd - "docs: Document Zero-Allocation architecture in HeaderCanvas (#8652)" on Jan 14, 2026, 8:44 PM
tobiu assigned to @tobiu on Jan 14, 2026, 8:45 PM
tobiu
tobiu Jan 14, 2026, 8:45 PM

Input from Gemini 3 Pro:

✦ Documented the Zero-Allocation Architecture in HeaderCanvas.mjs:

  • Added a "Performance Architecture" section to the class JSDoc explaining the strategy.
  • Documented waveBuffers as the core mechanism for eliminating GC.
  • Clarified the calculateStrandGeometry contract (writing to existing buffers).

This ensures the performance intent is clear for future maintenance.

tobiu closed this issue on Jan 14, 2026, 8:45 PM