scratch-vm icon indicating copy to clipboard operation
scratch-vm copied to clipboard

Suggestion: Compile broadcasts once per project start

Open softedco opened this issue 1 year ago • 4 comments

Broadcasts essentially work as events or as an interface for interacting between sprites, but when they are compiled each time they are run it creates performance issues, especially when you have multiple receive hats which based on testing creates additional overhead with each new hat block, even if they are empty. This has been a huge problem for me since I am making an engine where it's internals need to be incapsulated from the end user. An interactor sprite is required for this which creates a system where the performance bottleneck is mainly on the engine and the interactor sending messages. I think broadcasts need to be compiled only once since you can't trigger a project start with them. There isn't really a reason for them to compile with each run apart from the fact that the receive block is a hat block which share compilation conditions.

softedco avatar Oct 04 '23 10:10 softedco

The actual compiling is already cached until you edit the project

GarboMuffin avatar Oct 04 '23 13:10 GarboMuffin

Oh, if you can could you tell me what's causing the overhead then?

softedco avatar Oct 05 '23 01:10 softedco

send the project file here or [email protected]

GarboMuffin avatar Oct 05 '23 03:10 GarboMuffin

Here BroadcastsThing.zip Enable 60 fps to see the difference or just add more receive hat blocks

softedco avatar Oct 05 '23 12:10 softedco