scratch-vm
scratch-vm copied to clipboard
Suggestion: Compile broadcasts once per project start
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.
The actual compiling is already cached until you edit the project
Oh, if you can could you tell me what's causing the overhead then?
send the project file here or [email protected]
Here BroadcastsThing.zip Enable 60 fps to see the difference or just add more receive hat blocks