What is the solution for speed for Year 15 "Shred Lines"?

I'm playing 7 Billion Humans, and I'm stuck on finding the speed solution for year 15 "Shred Lines".

My current solution (for Size) runs in 26s, but i need to shave of 3 more seconds to get the Speed challenge.

enter image description here

Any pointers on how to make it in time?


You can pull both the steps out of the inner-loops, which saves two conditional-checks per outer-loop.

This works because there are no cubes directly above any worker's starting square:

Puzzle starting conditions