Skip to content

keys_highway_3d: updateScene iterates every note mesh each frame #95

Closed

Description

@cchacs

Version: keys_highway_3d 0.2.3 (core main @ b7067cf) — not fixed on claude/keys-highway-bugs-ho8fs6

What happens

updateScene() loops over the whole noteMeshes array twice per frame: once for the camera span, and once for positions, label sprites and key glow. It also loops over every bar-number sprite. The cost grows with the length of the chart, not with how many notes are visible, and every note also carries its own label sprite and material. The core CLAUDE.md performance guidance recommends limiting per-frame work to the visible time window, using bundle.lowerBoundT or a cursor.

Suggested approach

_notation.playable is already sorted by time. Keep a lower-bound index for now - 0.4 (the earliest note still needed) and stop the loop once a note is past the far end of the highway (about 8.8 s ahead, plus the length of the longest note). Only notes crossing the window edges need their visibility toggled.

Impact

I haven't profiled this. For short charts it's probably negligible; long or dense piano scores (thousands of notes) are where it would show. Confidence: moderate that it's measurable, low on how large the effect is.

Activity

  1. pullfrog commented on Sep 23, 2026

    @pullfrog
  2. added theissue type on Sep 23, 2026
  3. pullfrog commented on Oct 6, 2026

    @pullfrog

    Opened PR #141 (#141) implementing issue #95: updateScene now window-walks the t-sorted note/marker arrays via advanceTWindow (delta-hide on exit, bounds from runway geometry + longest note, shared linger constants), with 10 new tests (1449/1449 full JS suite green, eslint clean) and a reviewfrog self-review whose three minor findings are all addressed.

    Task list (2/7 completed)

    Pullfrog  | View workflow run | via Pullfrog | Using big-pickle (free) | 𝕏

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

    enhancementNew feature or request

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions