spark-viewer icon indicating copy to clipboard operation
spark-viewer copied to clipboard

`/tick warp`/`tick sprint` during a spark profile can cause TPS values to overflow their container

Open James103 opened this issue 10 months ago • 0 comments

To reproduce:

  1. Install Minecraft 1.20.1 or 1.20.4.
  2. Install Fabric Loader 0.14.7.
  3. If you installed Minecraft 1.20.1, install Spark 1.10.53 (https://modrinth.com/mod/spark/version/1.10.53-fabric). If you installed Minecraft 1.20.4, install Spark 1.10.58 (https://modrinth.com/mod/spark/version/1.10.58-fabric).
  4. If you installed Minecraft 1.20.1, install Carpet Mod (https://modrinth.com/mod/carpet/version/1.4.112).
  5. Start Minecraft.
  6. Create a new Superflat world, using "The Void" preset.
  7. For best results, set randomTickSpeed to 0, disable spawn chunks and mob spawning, and reduce your render and simulation distances as low as possible.
  8. Run /tick warp 7200000 (1.20.1) or /tick sprint 360d (1.20.4).
  9. Run /spark profiler start, then wait at least 1 minute.
  10. Run /spark profiler stop.
  11. Check the resulting profile. If there are TPS values greater than 1,000, they overflow the container, as shown below. image

An example profile with such TPS values is attached: https://spark.lucko.me/sXEWUwiWC8 (local copy attached: sXEWUwiWC8.zip)

A possible solution would be to truncate TPS values over 1,000 to the nearest integer, or rewrite the viewer GUI to dynamically adjust the size of the container holding the TPS values based on how large they are.

James103 avatar Mar 30 '24 23:03 James103