Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-81098

RS Dust Updates = LAG (and a lot of it)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Postponed
    • Resolution: Unresolved
    • Affects Version/s: Minecraft 1.8.7, Minecraft 1.10.2, Minecraft 16w41a, Minecraft 17w18b, Minecraft 1.12.2
    • Fix Version/s: None
    • Confirmation Status:
      Community Consensus

      Description

      Redstone dust causes immense amounts of lag on servers (including local SinglePlayer "servers"), and here's why (deduced from the game code, as well as a mod I wrote to help track down some redstone querks):
      Except for a redstone dust block updating (at least) 23 blocks around it, every time it is placed or receives any sort of update, apparently, redstone dust also DOES NOT directly de-power, as you'd expect. Instead, it continually loses 1 signal strength until it's "satisfied" and a check fails, meaning it doesn't need to update anymore. The 15 signal strength levels it needs to lose (one-by-one, mind you), each time causing at least 23 block updates, all happening within 1 gametick (1/20th of a second, around 15 * 23 = 345 block updates in total) cause a lot of unnecessary calculations to be done. Not only that, but this example only involved one piece of redstone dust. Imagine the same happening with a line, or even a grid. There it's even worse, since the dust blocks update each other again and again multiple times in 1 single game tick, so that a line of 15 redstone dust can easily amount to around 2,500 block updates in total.
      Each calculation is independently quite quick and simple, but any calculation run 2,500+ times in a 1/20th of second, where a lot of other calculations also need to run in that short time frame, is heavy, to say the least.

      I suggest rewriting the redstone dust update code, as it is quite simple and will reduce a whole load of lag on any server with redstone clocks running.
      Redstone dust is a horrible lag causer, and it does so in one of the most unnecessary ways in the entire game.

      Here is a short clip demonstrating (using my mod, as mentioned above) how 1 piece of redstone dust alone causes 15 * 23 = 345 block updates when de-powering:
      https://www.youtube.com/watch?v=T3bST3JGgas

      Final note: The "Affected Version/s" field only allows set versions, and only the most recent ones, however, this "bug" has existed ever since redstone dust was added to the game, all the way back in Alpha 1.0.1.

      Possible solutions

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rockenroll4life rockenroll4life (Josh Letellier)
                Reporter:
                Sharir Sharir
              • Votes:
                209 Vote for this issue
                Watchers:
                87 Start watching this issue

                Dates

                • Created:
                  Updated:
                  CHK: