[squeak-dev] Idle MVC RootProject is very CPU hungry

Vanessa Freudenberg vanessa at codefrau.net
Sun Apr 12 15:57:46 UTC 2020


On Sun 12. Apr 2020 at 08:39, David T. Lewis <lewis at mail.msen.com> wrote:

> On Sun, Apr 12, 2020 at 03:42:42PM +0200, St??phane Rollandin wrote:
> > Hello,
> >
> > I just noticed that the top-level RootProject, when entered, makes the
> > VM take a lot of CPU (a full core on my system, which amounts to 100%).
> >
> > I'm on windows 8.1.
> >
> > Is this expected?
> >
>
> No, it is not expected. At least I didn't expect it.
>
> I see the same behavior on Linux. I also tested with a trunk-level V3
> image on an interpreter VM, and see the same.
>
> So it is not the VM, and it is not the operating system. It happens in
> any MVC project, and I also notice that the CPU usage goes back down
> to about 25% if I open anything in the MVC project, such as a workspace
> or a browser or even an mouse-click world menu.
>
> It looks like the ScreenController is just looping on fetch more events
> with no delays involved, and the activity seems to drop down when there
> is something for other controllers to do.
>
> Leaving a workspace open in the root project is a workaround.


We did add delays to the menu loops etc. many years ago. Sounds like
ScreenController needs that, too?

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.

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.

- Vanessa -

>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200412/be1ea963/attachment.html>


More information about the Squeak-dev mailing list