Skip to content

Raw cursor playback and export repeatedly scan mouse events from the start #2488

Closed

Description

@AksharP5

Description

With Smooth Movement disabled, GPUI playback and export prepare cursor position, velocity, and motion-blur history by scanning mouse events from the beginning on each query. The CPU work grows as playback advances through a long recording.

The callers already construct PrecomputedCursorTimeline, but ProjectUniforms::new_with_precomputed_cursor bypasses it when the effective cursor configuration is raw. A raw cursor style override on a smoothed project follows the same path.

Reproduction

  1. Open a long Studio recording with frequent mouse movement in the GPUI editor.
  2. Disable Smooth Movement in the cursor settings, or apply a raw cursor style override.
  3. Play near the end of the recording, or export it.

The accompanying PR's ignored benchmark_raw_cursor_uniform_preparation test reproduces the CPU cost through the production constructor, independently of decoding and GPU rendering, using synthetic continuously moving 60 Hz traces.

On a one-hour trace with 216,001 moves, median preparation near the end was 684.808 µs on main and 0.502 µs with ordered lookup (three sequential runs; 512 measured frames after 32 warmups). These are CPU preparation timings, not total playback or export timings.

Additional Context

  • Cap source: main at 40b06b92ac57b87f9bdb52e4eff8429d0ea319c3.
  • Environment: Omarchy (Arch Linux) x86_64, Intel Core i5-14400F; Rust 1.88.0, release opt-level 3.
  • Verified through the production constructor and native rendering tests; interactive app execution was not tested.
  • The fix checks ordering once and uses binary lookup, keeping the original scan for unordered sources. Rendered output is byte-identical in the regression fixture.

Activity

  1. linear commented on Oct 13, 2026

    @linear
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions