mojira.dev
MC-219853

Debug profiler says 'ticks' for 1 tick

The bug

The debug profiler says 'ticks' for one tick.

How to reproduce

  1. Press F3 + L twice

  2. Navigate to your minecraft folder -> debug -> profiling, and extract the contents of the .zip file

  3. Open the deviations folder

  4. Open any file
    ❌ Even though only one tick is shown, the text says '1 ticks'

Code analysis

Code analysis by @unknown can be found in this comment.

Linked issues

Comments 5

This is not new to the snapshot or specific to the client reports; the server reports (/debug) are exactly the same. So I added 1.16.5

I can confirm this in both 1.18.1 and 1.18.2 Pre-release 1. Here's a code analysis of this issue.

Code Analysis:

The following is based on a decompiled version of Minecraft 1.18.1 using MCP-Reborn.

net.minecraft.util.profiling.FilledProfileResults.java

public class FilledProfileResults implements ProfileResults {
   ...
   protected String getProfilerResults(long $l, int $i) {
      StringBuilder stringbuilder = new StringBuilder();
      ...
      stringbuilder.append("Tick span: ").append($i).append(" ticks\n");
      ...

If we look at the above class, we can see that no checks are carried out to see what the value of the tick span is before printing the word "ticks" within the debug profiling report. In simpler terms, the word "ticks" is hardcoded therefore, will always be printed regardless of the value of the tick span.

Can confirm in 1.19.2. This ticket relates to MC-255060.

[Mod] markderickson

(Unassigned)

Confirmed

(Unassigned)

1.16.5, 21w11a, 21w14a, 21w16a, 1.17 Pre-release 1, ..., 1.18.2 Pre-release 1, 1.18.2, 1.19 Pre-release 1, 1.19.2, 1.19.3

Retrieved