mojira.dev
MC-123584

Updating blocks creates lag spikes proportional to geometry in chunk section

The bug

Any block change seems to trigger a redraw of the entire chunk section. This is most noticeable when breaking and replacing blocks, but is also caused by wheat growing, for example. Lag is increased depending on the geometry inside the chunk section – complex models like fences cause greater lag.

This is client-side rendering issue since when filling large areas the command success message appears almost instantaneously in the log but the game freezes for some seconds.

When the debug rendering pie chart is visible the following warnings are logged:

[21:20:51] [Client thread/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup.rebuildNear.build near' took aprox 223.112349 ms
[21:20:53] [Client thread/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup.rebuildNear.build near' took aprox 1796.166532 ms
[21:20:53] [Client thread/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup.rebuildNear' took aprox 2046.063861 ms
[21:20:53] [Client thread/WARN]: Something's taking too long! 'root.gameRenderer.level.terrain_setup' took aprox 2046.184909 ms
[21:20:53] [Client thread/WARN]: Something's taking too long! 'root.gameRenderer.level' took aprox 2049.560368 ms
[21:20:53] [Client thread/WARN]: Something's taking too long! 'root.gameRenderer' took aprox 2051.362563 ms
[21:20:53] [Client thread/WARN]: Something's taking too long! 'root' took aprox 2054.692309 m

How to reproduce

  1. Use the following command

    /fill ~1 ~1 ~1 ~15 ~15 ~15 oak_fence
  2. Place or break a block next to the filled fences

Linked issues

MC-230198 I think trees are killing my FPS Resolved MC-149074 Massive Frame Drops in Bamboo Farms Resolved MC-170224 Lighting lag something to do with skylight. Resolved MC-151678 Imense FPS Drops and Stuttering when breaking/placing Blocks Resolved MC-194967 Redstone contraptions causing horrendous lag Resolved

Attachments

Comments 119

Looking at the video, MC-123263 might be related

This example might lead to a fix, or at least a better understanding: https://www.dropbox.com/s/74qnxaqpghh9uxr/Chunk%20Lag.mp4?dl=0

[Mod] Michael, i'm going to check if the same "Client thread/WARN" happen aswell...

I confirm, this is issue is 100% related to this one. See below what the Log-Output was writing:

16:48:06 wj Client thread warn Something's taking too long! 'root.tick' took aprox 139.149578 ms
16:48:06 wj Client thread warn Something's taking too long! 'root' took aprox 185.002342 ms
16:48:06 wj Client thread warn Something's taking too long! 'root.tick' took aprox 122.662909 ms
16:48:06 wj Client thread warn Something's taking too long! 'root' took aprox 166.025208

Note: I noticed when the pie sort of " over load" it will only show the following:
the " Level" is suppose to be the Render
-Level: 85,00% 58.50%
gui: 15% 10%
unspecified: 0.36% 0,24%

Confirmed, 18w09a
My issue report is related to this one, and i'll update it when i check. I'll not confirm for further version.

Affects 18w11a.

I think this occurs not when there are blocks "listening for block changes", but instead when there is a reasonable amount of geometry in the chunk. I've attached

[media]

, which has examples set up to reproduce the lag. World may take a few moments to load up.

109 more comments

Using: ( "GCTimeRatio": 0, 
  "ao": false, 
  "spriteAtlasTextures": false ) Patches the issue, would prefer a more optimal solution.

incorrect version tag stating 1.21, it stops at 1.20.2 mostly.

marcono1234

(Unassigned)

Confirmed

Platform

Important

Block states, Performance, Rendering

blocks, lag, lag-spike, rendering

Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w07c, Minecraft 18w09a, Minecraft 18w11a, ..., 1.19.3, 1.19.4, 23w16a, 1.21, 1.21.4

Retrieved