User:Cruddly/Lag

Abstract
There are several mechanisms that cause lag, however the worst by far are activated hoppers, even when they are not transporting items. Suprisingly, hoppers on a fast clock were lag-free.

Methodology
A test world was created and hosted by Cruddly using MCEdit for its copy and paste abilities, containing completely separate regions (~500 block separations) of various lag-causing entities and a remote player (Xenoflot) on a reasonable Internet connection (63ms ping to server), and reasonable but average computer. The server (ver 1.7.9) was running off a ramdisk on a powerful 8-cpu modern computer with just the host and the single remote player present, to eliminate other possible causes of lag. The results so far are reported below.

Results
4096 chained, activated hoppers, with NO items moving them: chests were unopenable even after several minutes of waiting, blocks unbreakable and unplaceable.

4096 chained, de-activated hoppers: no lag

4096 stationary minecarts with chests: no lag

4096 shuttling minecarts with chests: player was kicked, server crashed out of memory. In other tests with more memory, even the local player experienced visual lag as well as block placement etc issues.

4096 stationary activated minecarts with hoppers: worse lag effects than plain hoppers.

4096 stationary de-activated minecarts with hoppers: no lag

4096 droppers with no active clock circuit: no lag

4096 droppers moving items on a 2-tick clock circuit (via torch towers): no lag!!! Unbelievable. Slower clock speed tests abandoned. The droppers were checked to ensure the items were moving along. Remote player could clearly see the flashing patterns of the torches "like a christmas tree".

4096 chests (configured as 2048 large chests): no lag - control set.

Additional tests:


 * 4096 blocks of vertically flowing water: no lag
 * 4096 blocks of horizontally flowing water: no lag
 * 4096 fire blocks (flaming Netherrack): no lag. An interesting result, and maybe only due to the test setup having nothing but airspace near the fires, as fire-based lag has been experienced before.


 * 4096 stained glass blocks, single depth, single color: no lag
 * 4096 stained glass blocks, two colors, adjacent vertical planes: no lag
 * 4096 stained glass blocks, two colors, air block plane between the vertical planes: no lag

Conclusion
Although it is highly unlikely a single set of loaded chunks would contain 4096 of the tested items, never-the-less small numbers still create noticeable lag - to a small degree dependant upon: the hardware of both server and client, and Internet speed between them.

With the proliferation of hoppers in recent devices, it is advisable for designers to find ways to deactivate hoppers that are not currently in use - either automatically through circuit design, or manually via levers and so on. Where space allows for the accompanying power transmission, droppers are a far more reasonable alternative, and redstone clocks far less laggy than their hopper counterparts.

It doesn't take long before a dozen different devices, all containing at least several hoppers, add up to a noticeable lag burden upon remote clients.