shoes / shoes3

a tiny graphical app kit for ruby
http://walkabout.mvmanila.com
Other
181 stars 19 forks source link

Shoes high CPU utilization #387

Closed dredknight closed 6 years ago

dredknight commented 6 years ago

Hey everyone,

Just noticed that when Shoes app is launched CPU goes 40% higher and stays there. It happens on both my apps and Shoes manual too. CPU util with no shoes app - ~20% CPU util with shoes app active (just started no clicking or animation) ~60-70%

Why is this happening? Here is the app window that is working

image

I am using the latest stable verssion 3.3.4 r3079. This happens even when the manual is open. The system (windows 10) specifics that experience this issue is : image with HDD

I will test on a more powerful hardware tomorrow.

IanTrudel commented 6 years ago

This might need more testing because CPU usage is not warrant of a problem. Each operating system has its own strategy to deal with the foreground application. Windows may simply allocate more CPU because it is in foreground and no other application is needing CPU.

You might want to try to minimize it first and see whether it goes down or not. You might also want to try with other applications running and see whether it interferes or not.

Was the previous version of Shoes a problem?

IanTrudel commented 6 years ago

CPU util with shoes app active (just started no clicking or animation) ~60-70%

Windows disk I/O isn't that great by the way. That could explain the peek. :)

If it's a laptop, it's probably a 5400 RPM HDD. Terribly slow.

You might want to check starting other apps and compare.

I can't even test on my computers. They ain't waiting for no one with their RAIDs and SSDs.

dredknight commented 6 years ago

Was the previous version of Shoes a problem?

I was on 3.3.3 and after the issue was noticed I decided to upgrade.

It is not laptop it is standard tower pc. HDD is 7200 but it is old (~5 years). I tested on a cutting edge hardware (intel core i7 at 2.5GHz, 8GB DDR3) it works normally.

When I am back at the other machine I will move the app on the SSD and see if there is difference. It is possible that the time has come for a new HDD.

IanTrudel commented 6 years ago

When I am back at the other machine I will move the app on the SSD and see if there is difference. It is possible that the time has come for a new HDD.

This is what I suspect. You might have bad blocks on this old HDD causing the OS to read more frequently. Once again Windows is pretty bad with such things.

dredknight commented 6 years ago

Experiment 2. Old config + SSD = same CPU result. Moreover when the app is minimized the CPU is still consumed. image That value was about 5% before shoes was launched.

dredknight commented 6 years ago

I do not have a clue what is going on. Unless I get some revelation the next few days I will be closing this one.

IanTrudel commented 6 years ago

You might want to leave this issue open. It needs further investigation.

ccoupe commented 6 years ago

You could try the Shoes profiling ability. - Instructions are somewhere on the wiki.

IanTrudel commented 6 years ago

Reference: https://github.com/shoes/shoes3/wiki/Profiling

dredknight commented 6 years ago

Thanks! Launched it, waited 10 seconds and stop it. No any user actions were done whatsoever. Here is the result.

I read the article but I do not know how to interpret the values, etc. is the high too high or just normal? Note: I skipped some near zero rows.

By call count image image

By method time image image

ccoupe commented 6 years ago

Looks like it draws a lot, but we knew that. It doesn't look unusual to me so it's not likely be your program, unless there was a lot of paging and with 8GB, probably not. On my VM, win7, idle shoes splash screen can get to 100% of one cpu core. Not good.

I did change Windows polling of events in 3.3.4 (or 3.3.3 ?) to improve download speed and that may be the cause. I can test that.

ccoupe commented 6 years ago

@dredknight , new beta 3.3.5 for windows should reduce your cpu consumption. Built from master so none of that event drama. Let me know what it does for you.

dredknight commented 6 years ago

@ccoupe what kind of sorcery is this? It works!

When idle (maximized or minimized) CPU usage is 0%. It gets triggered only when computing events.

ccoupe commented 6 years ago

Closing.