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

High memory and cpu usage for loadchart widget #3

Open
felixhageloh opened this issue Sep 2, 2014 · 0 comments
Open

High memory and cpu usage for loadchart widget #3

felixhageloh opened this issue Sep 2, 2014 · 0 comments

Comments

@felixhageloh
Copy link

You probably saw this one coming :)

So I noticed very high memory usage and cpu spikes when I used this widget. I rewrote it a bit to solve these issues and made a gist: https://gist.github.com/felixhageloh/f6e208a275b458169ac2.
I made it a gist and not a pull request because I'm not 100% it does the same as the original (mostly when it comes to scaling and animations). So I thought maybe you can use this more as a reference. In a nutshell, what I changed is:

  • not using local storage to store loads. Also making sure that the array of loads doesn't grow indefinitely
  • not deleting an re-creating all bars on every update. Existing bars are re-scaled if necessary. The rescaling is still somewhat slow and there are probably cleverer solutions for it.
  • using css scale to control bar height. This makes it faster to animate

If you have feedback or questions, let me know!

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

1 participant