You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #448 I removed BlTastAtQueue. AFAIU, we gained in code comprehension (Bloc is a bit simpler after removing it) but may had lost bit of performance in repeated tasks. Or maybe not, but there is place for improvement here. Example:
space :=BlSpacenew.
space show.
space root enqueueTask:
(BlRepeatedTaskActionnewdelay:500 milliSeconds;
action: [ space root background:Color random ];
yourself).
If we had a ton of those tasks waiting to be run (after the delay passed), we may notice it.
The point it that even if for 500ms the host's universe loop could be idle, it won't. It's a quite active wait: These delayed tasks are re-enqueued again and again (via BlSpaceTaskQueue>>#requeue:) on each loop pulse, after BlRepeatedTask>>#run determines if starting delay has not been surpassed yet.
This issue is to look for a better mechanism to postpone the starting of a task with simpler code than the old BlTaskAtQueue.
Additionally, a more "hacky" example, but where the same happens is in animations (subclasses of task):
space :=BlSpacenew.
space show.
space root addAnimation:
(BlNumberTransitionnewfrom:0; to:1;
duration:1 milliSecond;
delay:500 milliSeconds;
onStepDo: [ :t |
space root background:Color random ];
beInfinite;
yourself)
In this case, the the animation determines if the starting delay has been surpassed in BlBaseAnimation>>#step.
The text was updated successfully, but these errors were encountered:
In #448 I removed
BlTastAtQueue
. AFAIU, we gained in code comprehension (Bloc is a bit simpler after removing it) but may had lost bit of performance in repeated tasks. Or maybe not, but there is place for improvement here. Example:If we had a ton of those tasks waiting to be run (after the delay passed), we may notice it.
The point it that even if for 500ms the host's universe loop could be idle, it won't. It's a quite active wait: These delayed tasks are re-enqueued again and again (via
BlSpaceTaskQueue>>#requeue:
) on each loop pulse, afterBlRepeatedTask>>#run
determines if starting delay has not been surpassed yet.This issue is to look for a better mechanism to postpone the starting of a task with simpler code than the old
BlTaskAtQueue
.Additionally, a more "hacky" example, but where the same happens is in animations (subclasses of task):
In this case, the the animation determines if the starting delay has been surpassed in
BlBaseAnimation>>#step
.The text was updated successfully, but these errors were encountered: