This is how to make faster repeat loops in Scratch. "Standard loop" runs a regular repeat loop when clicked. Compare its runtime to "Fast loop" and "Faster loop" Press "See inside" to see how to do it.
This is an adaptation of Duff's device for Scratch. Duff's device: https://en.wikipedia.org/wiki/Duff%27s_device Duff's device works by trying to run the loop body several times per loop. For a batch size of 8, it does the following: 1. Run the body (n mod 8) times 2. Run the body, 8 times in a row, (n / 8) times When the loop runs many times in a row, this reduces the time spent on checking the loop counter by eight. For loops with small bodies, this is a major improvement. Performance can be improved further by increasing the batch size. However, this has diminishing returns, and causes other problems (such as the project becoming larger)