<div>On Sun 12. Apr 2020 at 08:39, David T. Lewis <<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>> wrote:<br></div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, Apr 12, 2020 at 03:42:42PM +0200, St??phane Rollandin wrote:<br>
> Hello,<br>
> <br>
> I just noticed that the top-level RootProject, when entered, makes the <br>
> VM take a lot of CPU (a full core on my system, which amounts to 100%).<br>
> <br>
> I'm on windows 8.1.<br>
> <br>
> Is this expected?<br>
><br>
<br>
No, it is not expected. At least I didn't expect it.<br>
<br>
I see the same behavior on Linux. I also tested with a trunk-level V3<br>
image on an interpreter VM, and see the same.<br>
<br>
So it is not the VM, and it is not the operating system. It happens in<br>
any MVC project, and I also notice that the CPU usage goes back down<br>
to about 25% if I open anything in the MVC project, such as a workspace<br>
or a browser or even an mouse-click world menu.<br>
<br>
It looks like the ScreenController is just looping on fetch more events<br>
with no delays involved, and the activity seems to drop down when there<br>
is something for other controllers to do. <br>
<br>
Leaving a workspace open in the root project is a workaround.</blockquote><div dir="auto"><br></div><div dir="auto">We did add delays to the menu loops etc. many years ago. Sounds like ScreenController needs that, too?</div><div dir="auto"><br></div><div dir="auto">Morphic has a main loop that uses the relinquish-cpu primitive. MVC does have many little loops (one in each controller) so it’s not as simple. OTOH, only one of the controllers is active at any time. Potentially the relinquish-cpu logic could be added to all of them to reduce idle CPU load.</div><div dir="auto"><br></div><div dir="auto">Btw, in SqueakJS I did a VM-level hack to reduce load. It detects when the sensor primitives are being called rapidly without any user input. That’s a good indicator for the image to be idle.</div><div dir="auto"><br></div><div dir="auto">- Vanessa -</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div>