Skip to content

[PERFORMANCE] Per-frame flowBorder computations waste CPU on non-active themes #402

Description

@Kirtan-pc

Description

Every animation frame in renderer.js, the code unconditionally computes getFlowSpeedProfile(), getFlowDirectionValue(), and flowTravelDistance regardless of which theme is active. These computations create merged settings objects and parse theme config — all wasted work for 11 out of 12 themes. On multi-monitor setups with multiple overlay windows, this waste is multiplied.

Steps to Reproduce

  1. Launch Paraline with any theme other than flowBorder active.
  2. Open the DevTools Performance tab on the overlay window.
  3. Record a profile and look for getFlowSpeedProfile, getFlowDirectionValue in the call tree.
  4. Observe that these functions execute every frame despite being irrelevant to the active theme.

Expected Behaviour

Flow border calculations should be guarded behind if (visualizerState.selectedTheme === "flowBorder").

Actual Behaviour

The computations run unconditionally on every animation frame (~16ms interval at 60fps).

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions