When setting up parallel processing for my script,
I noticed that the microprofiler displays prominent lag tags labeled “deferredThreads”.
What does this signify?
Upon changing the workspace’s SignalBehavior from Deferred to Immediate,
the “deferredThreads” tags were replaced by “RunSignals” tags.
However, the lag remained consistent.
The task scheduler has a strict pattern to executing stuff. Parallel always come first, and then serial. Firing events will always be done in serial (even though they are safe to call in parallel), so they must wait until the serial stage to actually take effect. That’s why they’re “deferred”, because they are being postponed.
Changing the SignalBehavior has no effect on parallel code because the events are going to be deferred regardless. SignalBehavior is really only meant for serial code, because the default behavior for serial events is that they will work immediately after being called. Setting the behavior to deferred means the events will wait to be sent all at once in bulk, which is the same exact behavior as calling events in parallel.
Probably because you have a bottleneck from firing all those events. Consider trying out alternative data transaction methods, such as SharedTables (which is designed for Parallel Luau)
Thank you. That was a great help.
sharing data on a SharedTable is significantly faster than using BindableEvent or Actor:SendMessage() .
The frame time dropped from around 35-40ms to 27ms with SharedTable in my team’s game.
However, SharedTable also causes deferredThreads.
Maybe I should avoid using too much data transfer between threads.