Skip to content

Profiler

For the Udon programs placed in the scene you have open, this shows the instruction counts and the number of extern calls in your browser. Programs built by compilers other than TsukimiSharp are shown too.

  1. Choose Tsukimi Profiler from the TsukimiCode menu
  2. The Unity editor opens one port on 127.0.0.1 and opens the page in your browser
PortIt uses the first free port starting at 8787. If every candidate is taken, an error appears in the console
If the browser does not openThe URL to open is printed to the console
What the page showsThe scene as it was when you chose the menu item. After changing the scene or your code, choose the menu item again
When the port opensOnly when you choose the menu item. Nothing is opened when the editor starts
ElementDescription
ProgramChooses which program to show. When the same program is placed more than once, the count is appended to its name
MapDraws entry points and nested loops as a diagram
TableShows the same content as a table of numbers
CodeShows the instructions that run, and decompiled pseudocode
MeasureRuns the program being shown and counts the extern calls made by each entry point
NumberHow it is counted
instructionsThe number of instructions in that method’s or loop’s range
externs (static)The number of externs in that method’s or loop’s range. What happens inside the methods it calls is not included
selfThe count for the range minus the counts for the loops directly inside it
externs (measured)How many externs the entry point called when you ran it with Measure. Calls made inside the methods it calls are included
ns / iterationA rough run time for one turn of the loop, in nanoseconds. It is never multiplied by the trip count
How to read itMeaning
Looking at static counts aloneThey show where the code is. They do not include how many times a loop runs, so they do not show where the time goes
measured > staticThat entry point calls other methods
measured < staticSome branches were not taken in that run
Measured counts for loopsThere are none. The run records how many calls were made, not which line made them
ControlDescription
ChartChooses the diagram shape, Treemap or Icicle. It starts on Treemap
WeightChooses which number the areas represent: externs (static), instructions, or externs (measured). Under externs (measured), loops that have no measured count are drawn hatched
Clicking a blockZooms into that method or loop
Control or markerDescription
Budget (externs)Sets a target number of extern calls. Rows are compared using the measured count when there is one and the static count otherwise, and rows above the target are marked over
Over budget onlyShows only the rows marked over
Flatten & sortDrops the nesting and sorts. Clicking a column header also sorts
every frameMarks entry points that are called every frame
really a method callMarks rows that look like a loop but are actually a call to a method that appears earlier in the file
Control or markerDescription
InstructionsShows the instructions that actually run after optimization. Extern lines are colored, and the number of vertical bars on the left is how deeply that line is nested in loops
extern lines onlyShows only the extern lines
DecompiledShows pseudocode rebuilt from the instructions. It is not the source you wrote. It is shown only for TsukimiSharp programs
The list on the leftLists each entry point with its measured and static extern counts as measured / static
When it runsOnly when you press Measure. Nothing runs when you choose the menu item
What it runsThe one program being shown. Only TsukimiSharp programs can be measured
How it runsEach entry point that can be called from outside is run once, with the fields left at their default values. For the same program, pressing it again gives the same numbers
The editor while it runsYou can keep using it. Only the browser page waits for the result
Entry points that did not runNo number is shown; they read did not run. This is kept distinct from a count of 0
What the numbers coverThe calls made on the path taken with default values. They are not the counts from actually playing