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

BUG: CPU High after Curve Use #876

Open
SebNik1 opened this issue Mar 6, 2023 · 11 comments
Open

BUG: CPU High after Curve Use #876

SebNik1 opened this issue Mar 6, 2023 · 11 comments
Labels

Comments

@SebNik1
Copy link

SebNik1 commented Mar 6, 2023

  • Describe the bug: As soon as I use any of the curves (the tools below the line tools) my projects will start to consume high cpu rate and my macbook fans run full power
  • How To Reproduce the bug: Construct anything with a curve in it
  • What should have happened: No unusual high CPU usage or fan running
  • Screenshots Bildschirmfoto 2023-03-06 um 22 08 50
  • What's your Desktop OS? MacOS 11.7.4
  • What's your Seamly version from Help/About? _Seamly 2023.2.13.238

First of all thank you very much for seamly2d, I very happly use it for over two years now. I have experienced the same problem with the curves before but as it persists I would like to kindly bring it to your attention. As soon as I use any of the curve tools Seamly2D starts using very high cpu usage. This persists even after deleting the curves again with no curves remaining in the construction. My Macbook Pro is a late 2013 with i7 2.3Ghz and 16GB of RAM. In regular cases seamly2d doesnt use more than 5% CPU at the max.

Maybe you can try reproducing this. I'd be very happy to hear from you.

P.S. in Addition I got trouble with the color scheme, if this is a user setting I'm sorry to trouble you:
Bildschirmfoto 2023-03-06 um 22 17 55

@SebNik1 SebNik1 added the bug label Mar 6, 2023
@slspencer
Copy link
Collaborator

@SebNik1 , Welcome to the project. Thanks for reporting these issues.

Would you create another issue for the color theme problem? Its easier to track problems individually. Thanks!

@slspencer
Copy link
Collaborator

@SebNik1 What's your CPU Utilization with the latest version, 2023.4.13.1812 downloadable here

@SebNik1
Copy link
Author

SebNik1 commented Jun 8, 2023

I am very sorry, I used to get notifications on respones here but seems I no longer get them and so I am replying with much delay.

First thank you for the respones. I will recheck the colour issue and open a new topic.

Regarding the CPU load I upgraded frequently and the problem sustained. Now I'm on 2023.6.5.206. Already some days ago I realized that it might be related to the zoom level.

Check this:
Bildschirmfoto 2023-06-08 um 21 18 39

vs:
Bildschirmfoto 2023-06-08 um 21 18 56

As soon as I cross the 100% zoom level the cpu load rises to a high level. Can you confirm that?

@SebNik1 SebNik1 changed the title BUG: CPU High after Curve Use / Color scheme BUG: CPU High after Curve Use Jun 8, 2023
@schrodere
Copy link

I'm also having this problem. For me, it seems not to have anything to do with the zoom level, but whether a spline is displayed. If there is a spline in my pattern but offscreen, CPU usage is normal. If I scroll over or zoom out so that the spline is back in view, CPU usage shoots up to max and stays there until the spline is removed or scrolled/zoomed out of view.

  • OS/computer: Currently running MacOS Ventura 13.4.1 on an M1 MacBook Pro, but have had the same problem on the last several versions of Monterey. I have not been able to reproduce this problem in any of several versions of Seamly on my other computer running Windows 10.
  • Seamly2D version: It's been happening for a while, but confirmed on at least the following OS/Seamly combinations:

@DSCaskey
Copy link
Contributor

@schrodere

Thanks for the feedback. This may help pinpoint why the cpu usage is high with the curves. I'm curious though what's different on the macOS builds that causes this compared to to Windows. Seems like there may be something in the curve graphic items that are calling (curve) items to be constantly repainted.... when in view.

@hermannloose
Copy link

hermannloose commented Dec 30, 2023

I also see this happening on Ventura 13.5 + Seamly 2023.12.18.149 after noticing battery drain.

seamly2d_busy_with_splines.txt is the output of asking Activity Monitor to analyze the process. I peeked into it only briefly, as I am not familiar at all with Qt and Mac development, but at a glance it seems to confirm a bunch of Qt event processing and drawing keeping the CPU busy, judging by the method names in the stack frames for utilization.

When I make a pattern piece including the curves in question, CPU usage appears to be fine while the curves are displayed in the Piece view. Usage briefly shoots up every time I am panning around in that view, without changing zoom level, which is a bit surprising, as I would have expected it to only paint once in that case, but then again I am unfamiliar with Qt.

@hermannloose
Copy link

Interesting: with the curves showing, CPU usage drops back to normal when "Toggle Control Points and Curve Direction" is turned off.

@DSCaskey
Copy link
Contributor

Yes. This is a known behavior. When the points are toggled on, it's causing a constant repainting of the curves. For some reason it's more apparent on Macs. When I get a chance I need to get back to figuring out exactly what event signals are triggering the repaints.

@hermannloose
Copy link

Another thing I noticed, where I am not sure if it makes the power consumption worse in this case, is that Seamly2D shows up as "Intel" rather than "Apple" in Activity Monitor on my M1 MacBook Air, so I assume these are not universal builds yet?

@csett86
Copy link
Collaborator

csett86 commented Dec 31, 2023

Yes, Qt 5.15.2 which we are using is still Intel only, but that does not add much to the CPU usage as the translation between Intel and Apple silicon is very efficient. The tight looping and constant repainting is the real issue, as described by @DSCaskey

@SebNik1
Copy link
Author

SebNik1 commented Jan 3, 2024

Interesting: with the curves showing, CPU usage drops back to normal when "Toggle Control Points and Curve Direction" is turned off.

Thank you all very very much for your effort in this! :)

And [hermannloose], I didn't know about this workaround, thats really good to know. I'll turn the control points off when not needed. Maybe there will be a fix.

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

6 participants