[2.0.24] Deconstructing lots of platform tiles at once is very slow
Posted: Wed Dec 11, 2024 5:44 am
Consider the following pointless platform:
Now if I delete all the tiles using alt-d or ctrl-x (it doesn't matter which): The left half of the column, and the last tile on the bottom-right get instantly deleted, whilst the remaining tiles get marked with a red 'x': It then stays like that for 20 ticks. Untill finally, the bottom tiles is deleted. The next tile also takes 20 ticks to get deleted.
Now if instead of the above, I only deleted the bottom half of the column (100 instead of 200 tiles), I get the same behaviour, except it only takes 10 ticks to delete each tile. Halving that again (to 50 tiles) gives 5 ticks.
(Thus deleting platform tiles appears to be an O(n²) operation).
In other words, it is literally faster for the player to delete a bit of the platform, wait for it to finish, then delete more, then to rely on factorio to delete the whole thing in one operation.
Note that I had no FPS/UPS drop doing this.
It has a 2×100 column of platform tiles.Now if I delete all the tiles using alt-d or ctrl-x (it doesn't matter which): The left half of the column, and the last tile on the bottom-right get instantly deleted, whilst the remaining tiles get marked with a red 'x': It then stays like that for 20 ticks. Untill finally, the bottom tiles is deleted. The next tile also takes 20 ticks to get deleted.
Now if instead of the above, I only deleted the bottom half of the column (100 instead of 200 tiles), I get the same behaviour, except it only takes 10 ticks to delete each tile. Halving that again (to 50 tiles) gives 5 ticks.
(Thus deleting platform tiles appears to be an O(n²) operation).
In other words, it is literally faster for the player to delete a bit of the platform, wait for it to finish, then delete more, then to rely on factorio to delete the whole thing in one operation.
Note that I had no FPS/UPS drop doing this.