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-123582 Rendering Error Resolved MC-123762 Extreme Frame Drop When Placing/Breaking Blocks Resolved MC-124153 MC-38433 is back/still in the game Resolved MC-126518 Redstone or lighting updates causing severe lag and framerate drops Resolved MC-130282 Decaying leaf blocks cause severe micro stuttering 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
Shane Van Aert

Can confirm in 1.19.4

Affects 1.21

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.

Minecraft386882

Affects 1.21.4. 

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