-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
A painting slows down after a while with tons of updates #946
Comments
Jsfiddle not good for perf monitoring so I uploaded this http://51.255.41.169/lcissue/test.html The data flow is constant, nothing changes in the way data is added into the chart and about 12min in the load get so heavy almost crash the page meltdown.movThe updates are fast af, but the lib should handle it, it did in the previous versions (early in the 3.x for sure) |
Hi @Tucsky, thanks for your report! Have you tried to reproduce the same issue in different browsers? Also, is it a type that you stated that there is a possible memory leak but measure CPU usage instead? Quickly looking at your data I can see that for some reason a browser slows down the rendering of the text (you can see that in this code all the library does is call I just kept the page for several minutes and didn't see any heavy memory usage though, every time I click on "Collect garbage" button it goes down for the same value (around 5-6mb in my case). Also the execution time is the same (less than 1ms). |
@Tucsky are you able to reproduce it in different browsers/PCs? |
Yes you are right, memory is not the issue it's the CPU, I was looking for an equivalent term but didn't find any 🙂 it's about the Time Axis canvas operations (fillrect, filltext etc) taking 100x longer than it should after some time. The time before it 'triggers' is relative to the amount of updates made per sec, and most likely the power of your own cpu. I have the full runtime performance snapshot of it if needed (about 20s before the heavy load starts to manifest and a few sec in). will try on other browsers asap |
@timocov I can absolutely reproduce the issue on my 15" 2015 macbook pro |
What version of Chrome do you use on your laptop and phone? It looks like the issue of the browser for now. |
@timocov I'm using 96.0.4664.110 (last version) on both |
@Tucsky could report this to Chromium please? I just tried to reproduce it on Also, as soon as you're unable to reproduce it in FF it only confirms that it's issue in Chrome. You can also check in Safari, but I believe you won't be able to reproduce it. |
Hey @Tucsky, did you file an issue in Chromium by any chance for this issue? |
No I did not, I am unable to reproduce the issue outside of this library |
Got it, thanks! We'll report to Chromium this issue then. It seems that it might be caused by some other scenarios and your repro is simple enough. I'll post a link here once it will be created. |
It seems that @kirchet found the cause of the issue. We'll provide a fix soon. |
Lightweight Charts Version: 3.7.0 & 3.8.0
Steps/code to reproduce:
Actual behavior:
CPU gradually increase (maybe more than it should?)
..then after like 20min CPU shoots up to 100% for no apparent reason
The whole update task takes about 250ms, 90% of it being dedicated to painting the time-axis-widget
This is what the same update looks like at the very beginning (takes about 15ms)
Once cpu goes 100% it doesn't come back. However I have found that changing layout font size fixes it
It's only temporarily tho, the CPU start to increase again and eventually melt up
CodeSandbox/JSFiddle/etc link:
https://jsfiddle.net/qktjy154/5/ - takes about 20min on my build (i7-9700 3.2ghz, 16gb ram), tab needs to remain active
Will update
The text was updated successfully, but these errors were encountered: