Mojira Archive
MCPE-135265

Marker entities are exceedingly laggy to both client and server

The bug

Moderately large amounts of marker entities cripple bedrock edition, even on the most powerful devices. The framerate tanks and the server screeches to a halt.

How to reproduce

1. Download and open the attached world.
2. Press the button repeatedly. Each time you do, the number of marker entities is doubled.
3. Repeat until the game becomes unplayable due to lag. For me, this happens around 2048 entities.
4. Compare to the java world, in which I can spawn over 130,000 marker entities before the server starts to slow down, and the client remains at a smooth 60 frames per second.

Notes

The Bedrock marker entity is defined in a behavior pack. It has no components, and no client entity definition. Therefore it really should not be costing any time on the client or server. If for some reason you actually need to add components to disable performance-costing features, please let me know so this test can be made more fair.

Here is a table comparison of the results I get:
(any number of entities below 32 results in differences too small to measure)

  Bedrock Marker Java Marker Java Area Effect Cloud
32 entities 60 FPS
1 ms avg
60 FPS
1 ms avg
60 FPS
0 ms avg
64 entities 60 FPS
2 ms avg
60 FPS
1 ms avg
60 FPS
0 ms avg
128 entities 60 FPS
3 ms avg
60 FPS
1 ms avg
60 FPS
1 ms avg
256 entities 60 FPS
7 ms avg
60 FPS
1 ms avg
60 FPS
1 ms avg
512 entities 60 FPS
18 ms avg
60 FPS
1 ms avg
60 FPS
1 ms avg
1024 entities 40 FPS
48 ms avg
60 FPS
1 ms avg
60 FPS
1 ms avg
2048 entities 3 FPS
170 ms avg
60 FPS
1 ms avg
60 FPS
2 ms avg
4096 entities  Unplayable 60 FPS
1 ms avg
55 FPS
4 ms avg
8192 entities  Unplayable 60 FPS
2 ms avg
40 FPS
10 ms avg
16384 entities  Unplayable 60 FPS
6 ms avg
20 FPS
23 ms avg
32768 entities  Unplayable 60 FPS
18 ms avg
2 FPS
58 ms avg
65536 entities  Unplayable 60 FPS
42 ms avg
 Unplayable
131072 entities  Unplayable 60 FPS
85 ms avg
 Unplayable

Note that every additional row is an order of magnitude more entities than the previous row, so Bedrock is considerably more laggy than it should be; the amount of entities that makes Bedrock unplayable is completely unnoticeable on Java, even on the same exact machine!

Compared to Java AECs, Bedrock markers are nearly 30 times laggier on the server, and 16 times laggier on the client!
Compared to Java markers, Bedrock markers fare even worse, with Bedrock being 64 times laggier on the server, and lagging the client even though Java markers don't lag the client at all!

This greatly affects mapmaking, in which marker entities are used frequently in both editions, and are only performant in java. Performance is especially critical on bedrock, since weak devices make up a plurality of the audience.

Unresolved

[Mod] tryashtar

2021-07-14, 11:08 PM

2024-08-23, 10:37 PM

7

3

Plausible

577097

performance

1.17.40.23 Beta - 1.20.51 Hotfix1.17.40.23 Beta, 1.17.40.21 Beta, 1.17.20.22 Beta, 1.17.10, 1.17.30, 1.17.32, 1.20.60.25 Preview, 1.20.60.24 Preview, 1.20.51 Hotfix

-