-
Bug
-
Resolution: Fixed
-
1.16.100, 1.16.200, 1.19.50
-
None
-
Community Consensus
-
Multiple
-
448558
xp_orb entities cause significant lag when they accumulate in mobs farms. This seems to be because they have mob collision boxes. The game has to repeatedly calculate their collisions with each other and with mobs. Most mobs drop 3 xp_orb each upon death, so the number of collisions being calculated increases exponentially as a mob farm runs. By contrast, item drops do not produce nearly as much lag because they do not have mob collision. I would expect xp_orb entities to interact with block collision boxes, pistons, and liquids like item entities do, and not to overload the game server and client with mob collision calculations.
The attached test world, XP lag.mcworld, can be used to compare lag produced by item entities and xp_orb entities. It consists of repeat command bocks that generate either one item entity or one xp_orb entity with each tick, and an impulse command block that kills all entities to reset the test.
Steps to reproduce
- Use a performance monitor to track CPU usage and FPS. The monitor included with the XBox Game Bar in Windows 10 works for this.
- In the attached test world, turn on the lever on the diamond block to drop item entities.
- Allow the game to run for 5 minutes or so and observe the performance monitor.
- Turn off the lever and press the kill button to reset the test environment.
- Turn on the lever on the gold block to drop xp_orb entities.
- Allow the game to run for a few minutes and observe the performance monitor.
- Turn off the lever and press the kill button to reset the test environment.
Expected result
The performance monitor shows similar changes in steps 3 and 6.
Actual result
In step 6, but not in step 3, CPU usage climbs steadily. If the xp_orbs are within the player's view, then from a certain point FPS declines steadily (FPS decline begins at about 45 seconds on my computer).
- is duplicated by
-
REALMS-9618 Uncollected XP orbs cause crippling framerate (even when off screen)
- Resolved
- relates to
-
MCPE-89260 Repeating redstone causes world lag
- Resolved
-
MCPE-167247 Experience orbs do not merge
- Resolved