AntiqueAtlasTeam / AntiqueAtlas

A Minecraft mod that adds a fancy interactive map item.
http://www.minecraftforum.net/topic/2045745-164forge-antique-atlas
Other
253 stars 72 forks source link

According to Spark, AA is consuming huge amounts of processing time #365

Closed pm065 closed 2 years ago

pm065 commented 3 years ago

Describe the bug I ran a Spark profiler when I noticed my game was running suspiciously slow. The TPS was consistently dropping down and mobs were sometimes moving in a stuttery way. This is the result: https://spark.lucko.me/EdmXfBLyrP

What surprised me: https://gyazo.com/442649dbde5ff2ecd8135b9ec14937e1

If I'm reading this right, Antique Atlas is taking up 70% of the processing time.

To Reproduce

  1. Install Spark and AA in a forge instance
  2. Go onto a world
  3. Spawn in some animals, notice the occasionally strange behaviour (stuttering, etc)
  4. Run a Spark profiler (/spark profiler)
  5. Wait for a bit, fly around
  6. Stop the Spark profiler (/spark profiler --stop)
  7. Open the link
  8. Click the process that's taking the most resources until you can't go any further
  9. Look at the processes mentioning AA

Expected behaviour A clear and concise description of what you expected to happen.

Forge version information:

tyra314 commented 3 years ago

Well, performance is quite a complex topic.

From what I'm seeing so far, I don't expect AA to be the actual culprit. While it looks like AA consumes a huge amount of processing time, it actually does not. When you dig down deeper into what takes the time, you can see, that all time is spent in World.getChunk() and deep down ends in LockSupport.parkNanos(). That basically means, AA is actively waiting for some other thread finishing so it can get the chunk it's trying to map.

I have nothing to point at, but I suspect that AA is simply waiting for world gen to be finished. Maybe your system is just slow, or some other mod blocks world gen somehow, or there is a chain reaction there newly generated chunks cause other chunks to be generated.

While I don't think AA is causing the issue, try disabling it and run Spark again.

SHXRKIEgg commented 3 years ago

Been using this mod in my Better Minecraft Modpack since the beginning and removed it in latest update due to how bad tps gets with it and removing the mod has fixed all tps issues so I have to agree pm065 that there is something wrong with the mod and tps.

tyra314 commented 3 years ago

With the amount of information given on this issue, I cannot do anything. Whenever you report performance issues, at least provide your system information! It's a major difference, if you have performance issues on a 15-year-old laptop or a brand new high-end gaming pc.

Also, as I'm suspecting at least a mod interaction problem, or even another mod, I need the modlist and versions.

SHXRKIEgg commented 3 years ago

Ill make a more informed Issue when I have the time but as it stands this happens on any Server Hosting sites like Bisect Hosting or on my PC for SP & MP which is a I9-9900K and RTX 2080 Super, 16 GB Ram 3200mhz, SSD. This isn't just my PC this was for all my players using my Modpack. It caused me to remove it due to the tps issues.

tyra314 commented 3 years ago

Well, I had a look at the linked mod pack with added AA and indeed, the performance is abysmal. I tried to gather some information on what's going on, and added a bunch of profiling information to AA, but some other mod in your mod pack fucks the built-in profiler. So there's that.

I still think there's a mod in your pack, that simply takes its time with world gen. Because in the attached build, I changed the way, AA requests chunks for cartography. It tells Minecraft to give it the chunk in any generation state available instead of the fully generated state. Hence, the waiting time for the chunk is low, but the downside to that is that the first scan won't be accurate. With that, I get very usable tick times.

antiqueatlas-6.0.2-forge-pre1-perf-patch-mc1.16.5.zip

tyra314 commented 2 years ago

6.2.0 has some performance optimizations. report back, if it's still a problem.