My research shows that using the [number of rows in] block in a loop block is much slower when it is not in the loop block.
I think the problem is that, firstly, this block is calculated very slowly and, secondly, it is calculated at each iteration of the loop, which looks quite strange to me personally.
Yes, I was not mistaken. 100 iterations for the [length of] block run on Android for 0.001 seconds, and for the [number of rows in] block when using Local DB - for 0.49 seconds (500 times slower)!