<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=Tracy%3A_timeline_profiler</id>
	<title>Tracy: timeline profiler - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.thedarkmod.com/index.php?action=history&amp;feed=atom&amp;title=Tracy%3A_timeline_profiler"/>
	<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Tracy:_timeline_profiler&amp;action=history"/>
	<updated>2026-04-29T19:26:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Tracy:_timeline_profiler&amp;diff=29823&amp;oldid=prev</id>
		<title>Stgatilov: Removed centering of images</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Tracy:_timeline_profiler&amp;diff=29823&amp;oldid=prev"/>
		<updated>2022-08-28T11:42:32Z</updated>

		<summary type="html">&lt;p&gt;Removed centering of images&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:42, 28 August 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l77&quot;&gt;Line 77:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 77:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Now let&amp;#039;s take a closer look at a single frame.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Now let&amp;#039;s take a closer look at a single frame.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Tracy Gameplay.png|960px&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|center&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Tracy Gameplay.png|960px]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One important thing to understand regarding performance is that some things work in parallel.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;One important thing to understand regarding performance is that some things work in parallel.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l114&quot;&gt;Line 114:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 114:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== Map load ====&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== Map load ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Tracy Mapload.png|960px&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|center&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Tracy Mapload.png|960px]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Loading every assets constitutes an individual activity on the timeline.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Loading every assets constitutes an individual activity on the timeline.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l124&quot;&gt;Line 124:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 124:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== Dmap compilation ====&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== Dmap compilation ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Tracy Dmap.png|960px&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|center&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Tracy Dmap.png|960px]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Stgatilov</name></author>
	</entry>
	<entry>
		<id>https://wiki.thedarkmod.com/index.php?title=Tracy:_timeline_profiler&amp;diff=29822&amp;oldid=prev</id>
		<title>Stgatilov: Initial commit</title>
		<link rel="alternate" type="text/html" href="https://wiki.thedarkmod.com/index.php?title=Tracy:_timeline_profiler&amp;diff=29822&amp;oldid=prev"/>
		<updated>2022-08-28T11:41:20Z</updated>

		<summary type="html">&lt;p&gt;Initial commit&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The typical developer&amp;#039;s approach for analyzing performance is using the builtin &amp;#039;&amp;#039;&amp;#039;sampling profiler&amp;#039;&amp;#039;&amp;#039; in Visual C++.&lt;br /&gt;
It provides the overall statistics for all the functions in C++ code, without requiring any markup.&lt;br /&gt;
However, sampling profiler only collects average/cumulative information: it cannot reveal that one frame in 10 is 3x slower, or that a particular entity takes too much time thinking.&lt;br /&gt;
&lt;br /&gt;
Since version 2.10, TDM ships with Tracy library integrated, which provides &amp;#039;&amp;#039;&amp;#039;timeline profiling&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
It relies on manual instrumentation of C++ code, and shows exactly all the activities that developer wanted to see when he was doing the markup.&lt;br /&gt;
It is very good at showing individual issues, like which single entity or area out of thousands takes too much time.&lt;br /&gt;
Tracy profiling can be easily used by non-developers: you don&amp;#039;t need to install Visual C++, and don&amp;#039;t need debug information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Preparation ===&lt;br /&gt;
&lt;br /&gt;
Start TDM executable and set cvar &amp;#039;&amp;#039;&amp;#039;com_enableTracing&amp;#039;&amp;#039;&amp;#039; to &amp;#039;&amp;#039;&amp;#039;1&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
When you first turn it on, it should print back the version of Tracy viewer that you need.&lt;br /&gt;
Go to [https://github.com/wolfpld/tracy/releases GitHub page of Tracy releases] and download the main archive of the suggested version. The Tracy viewer inside is called simply &amp;lt;tt&amp;gt;Tracy.exe&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If TDM does not print version of Tracy for you, then you need either 0.7.8 (TDM 2.10) or 0.8.1 (TDM 2.11 dev builds).&lt;br /&gt;
If you use Linux, then you&amp;#039;ll have to build Tracy yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Recording ===&lt;br /&gt;
&lt;br /&gt;
[[File:Tracy_Connect.png|150px|thumb|Connect button]]&lt;br /&gt;
[[File:Tracy_Stop.png|150px|thumb|Stop button]]&lt;br /&gt;
&lt;br /&gt;
Here are the steps to record a trace:&lt;br /&gt;
&lt;br /&gt;
# Start TDM.&lt;br /&gt;
# Start Tracy viewer.&lt;br /&gt;
# In Tracy viewer, click &amp;lt;tt&amp;gt;Connect&amp;lt;/tt&amp;gt; button.&lt;br /&gt;
# In TDM, set com_enableTracing to 1.&lt;br /&gt;
# Do whatever you want to analyze in TDM.&lt;br /&gt;
# Switch to Tracy and click &amp;lt;tt&amp;gt;Stop&amp;lt;/tt&amp;gt; button.&lt;br /&gt;
&lt;br /&gt;
Here is your trace, ready for analysis.&lt;br /&gt;
If you want to see the connection window again, click the &amp;quot;wifi&amp;quot; icon.&lt;br /&gt;
From there you can &amp;lt;tt&amp;gt;Save trace&amp;lt;/tt&amp;gt; on disk, or &amp;lt;tt&amp;gt;Discard&amp;lt;/tt&amp;gt; + &amp;lt;tt&amp;gt;Reconnect&amp;lt;/tt&amp;gt; to record a new trace.&lt;br /&gt;
&lt;br /&gt;
Note that if you run TheDarkMod as administrator, you&amp;#039;ll get a lot of additional low-level information, which you probably don&amp;#039;t need.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Analysis ===&lt;br /&gt;
&lt;br /&gt;
[[File:Tracy Activities.png|thumb|Activities]]&lt;br /&gt;
&lt;br /&gt;
You see timeline: the sequence of all events happened during recording, and all activities executed during that.&lt;br /&gt;
You can zoom timeline by mouse wheel and pan by dragging with right mouse button.&lt;br /&gt;
&lt;br /&gt;
Every activity is represented as a colored interval on the timeline, its type is written inside the interval is you zoom to it.&lt;br /&gt;
Activities are properly nested, for instance &amp;lt;tt&amp;gt;RunGameTic&amp;lt;/tt&amp;gt; activity has &amp;lt;tt&amp;gt;ThinkAllEntities&amp;lt;/tt&amp;gt; as a child, which in turns contains &amp;lt;tt&amp;gt;Think&amp;lt;/tt&amp;gt; for individual active entities.&lt;br /&gt;
Nesting is represented vertically: child activities are just below the parent activity.&lt;br /&gt;
Also, the game has several threads, which are separated vertically: you can collapse and expand display of activities for every thread.&lt;br /&gt;
&lt;br /&gt;
You can hover over an activity to see more info about it, and click it to see even more in a separate &amp;lt;tt&amp;gt;Zone info&amp;lt;/tt&amp;gt; window.&lt;br /&gt;
From this window, you can click &amp;lt;tt&amp;gt;Statistics&amp;lt;/tt&amp;gt; button to open &amp;lt;tt&amp;gt;Find zone&amp;lt;/tt&amp;gt; window.&lt;br /&gt;
This window shows total/average/count/median/whatever time for all activities of the same type.&lt;br /&gt;
Some activities have &amp;quot;User text&amp;quot; attached by programmer (like e.g. name of entity), which is displayed in yellow when you hover over activity.&lt;br /&gt;
A useful feature is to click &amp;lt;tt&amp;gt;Group by User text&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Sort by time&amp;lt;/tt&amp;gt; in radio buttons.&lt;br /&gt;
&lt;br /&gt;
Read the Tracy manual to learn more. It can be downloaded from Tracy releases page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Typical workloads for analysis are:&lt;br /&gt;
* Gameplay: in this case you should record for at least a few seconds to get meaningful stats.&lt;br /&gt;
* Map load.&lt;br /&gt;
* Dmap compilation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Gameplay ====&lt;br /&gt;
&lt;br /&gt;
[[File:Tracy Frames.png|150px|thumb|Frames]]&lt;br /&gt;
&lt;br /&gt;
It is easy to see periodic structure of frames in the timeline.&lt;br /&gt;
Tracy draws vertical lines where each frame ends, so you can easily see how much every frame took, what&amp;#039;s current FPS. You can also see spikes in frame processing time on the &amp;quot;minimap&amp;quot; at the top.&lt;br /&gt;
&lt;br /&gt;
Now let&amp;#039;s take a closer look at a single frame.&lt;br /&gt;
&lt;br /&gt;
[[File:Tracy Gameplay.png|960px|center]]&lt;br /&gt;
&lt;br /&gt;
One important thing to understand regarding performance is that some things work in parallel.&lt;br /&gt;
Suppose that task A takes 10 ms per frame, and task B takes 6 ms per frame, and you managed to optimize task B down to 3 ms.&lt;br /&gt;
If the tasks are run one after the other, then you have optimized your frame from 16 ms to 13 ms. But if they work in parallel, the overall frame time remains 10 ms.&lt;br /&gt;
The game would become visibly faster only if you optimized something on a thread which takes the most time (roughly speaking). This is usually called &amp;quot;bottleneck&amp;quot;, &amp;quot;limited by frontend&amp;quot;, &amp;quot;critical path&amp;quot;, etc.&lt;br /&gt;
&lt;br /&gt;
Tracy displays every thread as a separate vertical stripe, with the thread name displayed on the left.&lt;br /&gt;
Parallel threads often need to wait for each other, doing nothing useful: such waiting activities are colored grey.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is description of the main threads and workloads (as of TDM 2.10):&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Frontend&amp;#039;&amp;#039;&amp;#039;: runs a tic of gameplay modeling (&amp;lt;tt&amp;gt;RunGameTic&amp;lt;/tt&amp;gt;), then renderer frontend (&amp;lt;tt&amp;gt;R_RenderView&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Main thread&amp;#039;&amp;#039;&amp;#039;: runs renderer backend (&amp;lt;tt&amp;gt;R_IssueRenderCommands&amp;lt;/tt&amp;gt;), which interacts with OpenGL driver on CPU side.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OpenGL context&amp;#039;&amp;#039;&amp;#039;: GPU thread which actually executes OpenGL commands.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;JobListProcessor&amp;#039;&amp;#039;&amp;#039;: some work is off-loaded to these worker threads.&lt;br /&gt;
&lt;br /&gt;
Notice that rendering is split into three parallel tasks. Most of the work is done in frontend, which includes culling, particles, shadow volumes, animation, etc. Backend simply executes OpenGL API calls, letting OpenGL driver to do its stuff. Strictly speaking, OpenGL context is not a thread: it is the approximate view in what happens on the actual GPU device. For that reason, its activities are very special and not all Tracy features work for them.&lt;br /&gt;
&lt;br /&gt;
The rule of thumb is: if you see &amp;lt;tt&amp;gt;WaitForFrontend&amp;lt;/tt&amp;gt; at &amp;lt;tt&amp;gt;Main thread&amp;lt;/tt&amp;gt;, then frontend thread is the bottleneck. If you see &amp;lt;tt&amp;gt;Frontend::Wait&amp;lt;/tt&amp;gt; on &amp;lt;tt&amp;gt;Frontend&amp;lt;/tt&amp;gt; thread, then backend thread is the bottleneck.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are a few other details which greatly influence performance:&lt;br /&gt;
* Some gameplay work is done only once in several frames. The most prominent example is AI thinking (see [[Interleaved Thinking optimization]]). While such work is randomly scattered across frames, the gameplay modeling time still varies a lot.&lt;br /&gt;
* When FPS drops below 60, frontend thread executes &amp;lt;tt&amp;gt;RunGameTic&amp;lt;/tt&amp;gt; several times per frame, further reducing performance. However, all additional calls are cheaper because they almost totally exclude AI thinking ([https://bugs.thedarkmod.com/view.php?id=5992 #5992]).&lt;br /&gt;
&lt;br /&gt;
Settings which greatly affect the timeline:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Uncapped FPS&amp;#039;&amp;#039;&amp;#039; menu setting switches between two different ways of time management (see [[Time, frames and ticks]]).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;com_smp&amp;#039;&amp;#039;&amp;#039; allows to separate/merge &amp;lt;tt&amp;gt;Frontend&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Main thread&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Frontend Acceleration&amp;#039;&amp;#039;&amp;#039; menu setting controls off-loading some frontend work to worker threads.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Vertical Sync&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;r_finish&amp;#039;&amp;#039;&amp;#039; changes the way backend/GPU synchronize with all the rest.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;com_useMinorTics&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;com_maxTicTimestep&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;com_maxTicsPerFrame&amp;#039;&amp;#039;&amp;#039; control game modeling split behavior.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Map load ====&lt;br /&gt;
&lt;br /&gt;
[[File:Tracy Mapload.png|960px|center]]&lt;br /&gt;
&lt;br /&gt;
Loading every assets constitutes an individual activity on the timeline.&lt;br /&gt;
Usually all the referenced subassets are loaded recursively, so they become nested/children activities.&lt;br /&gt;
The major exception to this rule is images, which are loaded at the very end of the map loading, and in separate threads.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Dmap compilation ====&lt;br /&gt;
&lt;br /&gt;
[[File:Tracy Dmap.png|960px|center]]&lt;/div&gt;</summary>
		<author><name>Stgatilov</name></author>
	</entry>
</feed>