Skip to content

requestAnimationFrame loop keeps running in render modes on-demand, manual #1220

Description

@vincesp

Describe the bug

As a developer, I expect CPU usage of my browser tab to drop to 0% if using render-mode "on-demand" or "manual".
Actual behavior: requestAnimationFrame loop keeps running, CPU usage of 2%.

Reproduction

https://stackblitz.com/edit/tresjs-minimal-reproduction-4fdedjcb?file=src%2FApp.vue

Steps to reproduce

Run the stackblitz and observe the console in the developer tools. It will print "advance" once and then "loop" continuously, clocking away CPU cycles needlessly.

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 20.19.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @tresjs/cientos: ^5.1.0 => 5.1.0 
    @tresjs/core: ^5.1.0 => 5.1.0 
    @tresjs/leches: ^0.14.0 => 0.14.0 
    vite: ^6.0.3 => 6.0.5

Used Package Manager

npm

Code of Conduct

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions