Blueprint

Blueprint

57M Downloads

High CPU Usage for onEntityTracking with low entity count

NielsPilgaard opened this issue ยท 3 comments

commented

Relayed from: EnigmaticaModpacks/Enigmatica6#2717

Versions

  • abnormals_core-1.16.5-3.1.1
  • Forge-1.16.5-36.1.31

Describe the bug
In the server, while everything else works relatively smoothly, mobs move at like 1 frame per second. It affects mostly the whole world, but it is more noticeable in some areas. We tried clearing all the entities and various restarts to no avail. Spark showed abnormals_core taking more than 25% of the cpu usage, and it was almost entirely caused by EntityTrackingEvent. At one point mobs were mostly unresponsive and not a lot of entities were present, as can be seen in the mob list.

Logs
Spark profile of the server: https://spark.lucko.me/ypNP5dwCth?hl=48
Forge Entity Mob List: https://pastebin.com/hHsdTGmX

commented

I am unable to reproduce this issue with Abnormals Core alone.
Abnormals Core fires two instances of the EntityTrackingEvent inside TrackedEntity#tick().

Abnormals Core Suspect Reason:
There's only one built-in listener of this event in Abnormals Core that's used for syncing the data manager of 'dirty' entities.
It's not even common for tons of entities to have dirty IDataManager data that needs to be updated. And, even when there are tons of entities that need their IDataManager updated, it should be performing at fast rates compared to the many other processes that entities undergo.

Also, according to the report, a majority of the percentage of the performance is occurring in Forge's EventBus#post() method, not the listener lambda for the event in Abnormals Core, which is weird.
image
image

There isn't enough information here to warrant this as an Abnormals Core-only issue. It would be good to do more investigation into what might be the cause. I advise seeing if you can reproduce the issue alone and if not, try to figure out what other mods might be causing this issue when paired with Abnormals Core.

commented

Alright, thanks a lot for the information, I'll dig a bit further and see what I can find.

commented

The issue was found, it wasn't Abnormals Core :)

EnigmaticaModpacks/Enigmatica6#2717 (comment)