Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyboardJS seems to suck CPU #40

Closed
pgregory opened this issue Jan 1, 2017 · 1 comment
Closed

KeyboardJS seems to suck CPU #40

pgregory opened this issue Jan 1, 2017 · 1 comment
Labels

Comments

@pgregory
Copy link
Owner

pgregory commented Jan 1, 2017

Description

When holding a key for the virtual keyboard, something goes awry in the system, Chrome gets stuck in a mode where it is drawing CPU constantly, even thought the key is released. There doesn't seem to be anything in the WeTracker code causing this, as the VKB is only triggering a note on the key down, and then forcing no repeat, so I'm presuming it's something in the KeyboardJS code that is getting caught up.

Steps to reproduce

  1. Load WeTracker with the default empty song, with two instruments.
  2. Switch to instrument 2, the pad sound with looping.
  3. Hold the 'z' key down for a while, causing the instrument to play in a loop.
  4. Release the note.
  5. Review CPU usage of Chrome in the system process monitor.

Versions

  • OS: macOS Sierra 10.12.2
  • Browser: Chrome Mac 55.0.2883.95 (64-bit)
@pgregory pgregory added the bug label Jan 1, 2017
@a1k0n
Copy link

a1k0n commented Jan 1, 2017

Yep. The javascript profiler confirms:

screen shot 2016-12-31 at 9 15 55 pm

screen shot 2016-12-31 at 9 16 16 pm

pretty sure what's happening is that the keys are repeating, and it has to check to see if the repeated key is the same as what's already down.... that's a pretty heavy-handed way to do it. I wouldn't use that library...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants