mojira.dev
MC-1692

Excessive lag on lamp de/activation across chunk borders

See this video by @unknown for a demonstration of this issue.

Description

Redstone lamps turning on and off cause an unusually large amount of FPS lag when on/near chunk borders. While there is still some (expected) lag in the middle of a chunk, the amount on chunk borders is significantly higher.

Reproduction

  1. Enable chunk border rendering with F3+G

  2. Enable the lagometer and debug profiler by pressing Alt+Shift+F3.

  3. In the middle of a chunk, build an 6x6 pad of redstone lamps, and place redstone dust on those lamps.

  4. Connect those lamps to a fast clock (such as 2 repeaters pointing into each other)

  5. Observe that there is a slight lag spike each time the lamps turn on.

  6. Disconnect that system, and then build a similar 6x6 pad at the intersection of 4 chunk borders (such that there is a 3x3 area in each chunk)

  7. Connect that system to a fast clock

  8. Observe the much higher FPS drop

Notes

  • The profiler node "scheduledExcecutables.checkLight.checkedPosition < toCheckCount" is the most time-consuming one when this issue is in effect.

Linked issues

Attachments

Comments 27

The lag happens only when it is deactivated, just make a line with lamps and a lever, flip lever on: pretty expected, all turn on. flip lever off: crazy lag spike and huge delay

Very true, and a much simpler test than my original build. I have added a screenshot of an automated setup for reference.

The issue persists in 13w10b, tagged accordingly.

I can more than confirm this. I built a pretty big light machine and it works great, but most things I try to do with it can't go smoothly live thanks to this bug alone. One part of it turns on in 1 second but takes about 5 turning off.
But it's already noticeable from 9 redstone lamps on. This should be fixed urgently!

In 1.5.1 lamps alone (like in reporter's setup) are not affected by this issue. Contraptions with lamps powered off repeater clocks and/or through sets of repeaters are affected though, as are repeater/comparator oscilliscopes or light-emitting devices of similar complexity. Moreover, such contraptions can induce a lagging that is even more severe when player stands exactly 10 chunks away from said contraptions.

I cannot reproduce in 1.5.1 - I have a lighthouse with a blinking lamp (in fact, 8 lamps). No lag between if it is on or off (I have a switch to turn off the lamps)

17 more comments

I investigated a bit on this bug.

It seems to correlate with the debug Node "scheduledExcecutables.checkLight.checkedPosition < toCheckCount", which takes up >50% of the entire frame time when the contraption goes over a chunk border.

A Example of this can be found here: https://www.youtube.com/watch?v=af9Cgck1zGA

2x the same setup, once within one chunk, once on a chunk border.

Can confirm for 1.12.1.

Can confirm for all 1.13 snapshots.

Did you really try all of them? Even the ones that aren't available in the launcher anymore?
Actually, it doesn't matter, all versions are already marked as affected.

I've experienced it on every snapshot, yes.

Martok

Fry

Confirmed

client, rendering

Minecraft 1.4.2, Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w06a, Snapshot 13w10b, ..., Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w50a

Minecraft 18w43a

Retrieved