SoyTutta / MyNethersDelight

8 stars 11 forks source link

Mod taking up unusual amount of the server thread #57

Open meeprdib opened 5 days ago

meeprdib commented 5 days ago

As you can see here in this profiler, "My Nether's Delight" seems to be taking up a large amount of the server thread for a Farmer's Delight addon. image https://spark.lucko.me/2GxrCg5p4r

phoenix492 commented 5 days ago

Specifically, it appears whatever method you're adding to vanilla's frog is rather non-performant, taking up 14% of the server execution time in the above performance report. image

unnecessarymb commented 5 days ago

Comparing your code to vanilla, I noticed you are searching for cakes four times a second, as opposed to, say, the fox refreshing once every five seconds. This causes over 37,000 blockstate queries per second per frog. I suggest changing https://github.com/SoyTutta/MyNethersDelight/blob/3916354dfeaa25950a73fd67a534296607324cac/src/main/java/com/soytutta/mynethersdelight/common/entity/ia/EatMagmaCakeGoal.java#L28 COOLDOWN_TICKS to 100.