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

debounser for inputs? #60

Open
tomByrer opened this issue Jan 28, 2014 · 6 comments
Open

debounser for inputs? #60

tomByrer opened this issue Jan 28, 2014 · 6 comments
Milestone

Comments

@tomByrer
Copy link

Testing:

  1. MFiddle:Examples/2-way-binding
  2. type in the number box 99
  3. first time 9 key is pressed, the value entered is 09, & the sliders jump to the left
  4. second 9, the intended value of 99 is fully entered, & sliders jump to right

Though here only 2 sliders are affected, but imagine a large spreadsheet that graphs results? That could be alot of jumpiness in the SPA.
In another platform, we would prevent jumpy values (& reduce CPU usage) by having a global 'heartbeat' function. Please let me know if you want a demo/explanation (bit long to explain).

@francoisfrisch
Copy link
Contributor

That's interesting, what is the advantage of a global heartbeat over say implementing a throttle on the widget itself?

@tomByrer
Copy link
Author

When I tested in the DSP platform I was on, a global heartbeat added the extra help:

  • prevented extra triggers when more math down the line caused more GUI updates; we would de-bounce at a few key points
  • overall CPU reduction, since all GUI elements had reduced 'Frames Per Second' (12-15 FPS worked fine usually). Though for this project, I would test inside browser dev tools to ensure this is worth it.
  • easier to wrap head around & debug when triggers were synced (in that platform)

@francoisfrisch
Copy link
Contributor

That is pretty close to what we have at the moment. The draw is only triggered when there is data changes and so there are no unnecessary frames.
On the other hand it would be interesting to skip frames on a very regular interval and that might give a better user experiences than doing it on an adhoc basis.

@francoisfrisch
Copy link
Contributor

oops

@tomByrer
Copy link
Author

skip frames on a very regular interval

That could help when the input box or other GUI-data element is active, to help delay results until final input is entered. Typing you want to wait, unless it is an auto-populating dropbox, & you would still wait for a few characters/0.5 seconds Knobs I got away with 15FPS.

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

No branches or pull requests

3 participants