Skip to content

Broadcast and wait should not yield when dirty until return? #760

Open
@griffpatch

Description

@griffpatch

Here is a simplified project demonstrating a feature that I use in most of my scratch projects that acts differently in Scratch 2 & 3.

https://llk.github.io/scratch-gui/develop/#184390187

In Scratch 2 you can execute blocks that update the screen and then issue a broadcast and wait without the Scratch runtime yielding to do a screen update until the broadcast and wait completes.

In Scratch 3 the scratch vm apparently stops to update the screen before the broadcast and wait is issued? This results in projects running at half speed in Scratch 3 even when they are doing very little.

Another interesting issue... Try the project on turbo mode. It then runs at 30fps exactly... But remove the broadcast and wait and it jumps to run at 2730 fps. Now in Scratch 2 it runs super fast with the broadcast and wait as well as without. So something about broadcast and waits appear to be holding up turbo mode too?

More Info

I have identified that it is not to do with loops. See: http://llk.github.io/scratch-vm/#184430433
In this project, if it runs at 30fps, then both cats should 'just' pass the line.

Turbo Off, 60fps mode -> Runs at 30fps
Turbo Off, 30fps mode -> Runs at 15fps
Turbo On, 60fps mode -> Runs at 60fps
Turbo On, 30fps mode -> Runs at 30fps

So the questions are, why does a broadcast and wait cause the turbo mode to yield? And why do we get two yields instead of one when running without turbo.

Steps to Reproduce

Try this project in Scratch 2 and Scratch 3.

https://llk.github.io/scratch-gui/develop/#184390187

Operating System and Browser

Windows 10 Chrome

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions