Performance Profiling: Difference between revisions
(→FPS basics: expanded FPS to frame duration table with diag_captureSlowFrame examples and additional higher fps thresholds; added important note about total scope) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 13: | Line 13: | ||
== | == Setup == | ||
{{Feature|important| | {{Feature|important| | ||
Line 30: | Line 30: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Steam | === Steam Branch === | ||
AUTOMATIC (Recommended) - see also [[Arma_3:_Steam_Branches|Steam Branches]]. | AUTOMATIC (Recommended) - see also [[Arma_3:_Steam_Branches|Steam Branches]]. | ||
# Open Steam | # Open Steam | ||
# Right click on ''' | # Right click on '''{{arma3}}''' in your Steam Library, then '''Properties''' | ||
# Select the tab '''betas''' | # Select the tab '''betas''' | ||
# Finally, use the dropdown list to select the branch '''profiling - Performance Profiling Build''' | # Finally, use the dropdown list to select the branch '''profiling - Performance Profiling Build''' | ||
Line 58: | Line 58: | ||
== FPS | == FPS Basics == | ||
The duration the engine needs to compute all calculations in one cycle is called a frame. The frame | The duration the engine needs to compute all calculations in one cycle is called a frame. The frame rate, or frames per second (FPS) states how many cycles the engine could compute for a given second. | ||
{{Feature|important| | {{Feature|important|The shorter a cycle/frame, the higher the FPS.}} | ||
The shorter a cycle/frame, the higher the | |||
}} | |||
{{Feature|informative| | {{Feature|informative|One second is one thousand {{Link|https://en.wikipedia.org/wiki/Millisecond|milliseconds}} (1 s {{=}} 1000 ms).}} | ||
}} | |||
{| class="wikitable" | {| class="wikitable" | ||
! FPS !! seconds !! milliseconds !! fps sample !! s sample !! ms sample | ! FPS !! seconds !! milliseconds !! fps sample !! s sample !! ms sample | ||
|- | |- | ||
Line 110: | Line 104: | ||
|} | |} | ||
{{Feature|important| | {{Feature|important|'''total''' only works on a machine with [[hasInterface|interface]]. The equivalent for a dedicated server is '''sLoop''' and '''cLoop''' for a headless client.}} | ||
'''total''' only works | |||
}} | |||
== Duration | == Duration Parameter == | ||
* The duration parameter is a time measured in seconds. 0.3 (seconds) is the same as 300 ms / milliseconds. | * The duration parameter is a time measured in seconds. 0.3 (seconds) is the same as 300 ms / milliseconds. | ||
* It is used to determine what duration of a frame you consider abnormal or that you are interested in for other reasons. | * It is used to determine what duration of a frame you consider abnormal or that you are interested in for other reasons. | ||
* The first time such frame happens, the frame information will be captured - or put differently: when a situation occurs with a frame lasting longer than said duration. | * The first time such frame happens, the frame information will be captured - or put differently: when a situation occurs with a frame lasting longer than said duration. | ||
* 0.3 (<3 fps for the whole frame) is definitely something you should not see in a normal game. | * 0.3 (<3 fps for the whole frame) is definitely something you should not see in a normal game. | ||
* If you do not capture any frames with 0.3, try lowering it to 0.2 (200 ms / <5 fps) or 0.1 (100 ms / <10 fps). | * If you do not capture any frames with 0.3, try lowering it to 0.2 (200 ms / <5 fps) or 0.1 (100 ms / <10 fps). | ||
* If it triggers "too early" before the main slowdown happens that you want to analyze, increase it to a higher value, e.g. 1.0 for long freeze (<1 fps). | * If it triggers "too early" before the main slowdown happens that you want to analyze, increase it to a higher value, e.g. 1.0 for long freeze (<1 fps). | ||
== Scope | == Scope Parameter == | ||
{{Feature|important| | {{Feature|important|The '''scope''' parameter is {{Link|https://en.wikipedia.org/wiki/Case_sensitivity|case sensitive}}.}} | ||
The '''scope''' parameter is | |||
}} | |||
* '''total''' is name for the scope of the duration for the whole frame ('''sLoop''' on a [[Arma_3:_Dedicated_Server|dedicated server]], '''cLoop''' on a [[Arma_3:_Headless_Client|headless client]]). | * '''total''' is name for the scope of the duration for the whole frame ('''sLoop''' on a [[Arma_3:_Dedicated_Server|dedicated server]], '''cLoop''' on a [[Arma_3:_Headless_Client|headless client]]). | ||
Line 139: | Line 130: | ||
* The names for scopes/subscopes you can get from the diag capture dialog or in the frame capture logging files (.log/.trace). | * The names for scopes/subscopes you can get from the diag capture dialog or in the frame capture logging files (.log/.trace). | ||
== How to Capture == | |||
=== Client === | === Client === | ||
==== Current Frame ==== | ==== Current Frame ==== | ||
If you want to capture a snapshot of a current moment, there are a few options: | If you want to capture a snapshot of a current moment, there are a few options: | ||
1. Via | 1. Via {{Link|Arma 3: Cheats|Arma 3 Cheats}} | ||
# Press {{Controls|Shift|num-}} | # Press {{Controls|Shift|num-}} | ||
Line 170: | Line 160: | ||
* Outside multiplier, if you open the pause menu, the simulation for the mission is halted. So when you do a capture in that menu, you only get a capture for the menu simulation. | * Outside multiplier, if you open the pause menu, the simulation for the mission is halted. So when you do a capture in that menu, you only get a capture for the menu simulation. | ||
* To avoid that, you need to delay the execution until the pause menu is closed again. For example by: <sqf inline>(findDisplay 49) closeDisplay 0; diag_captureFrame 3;</sqf> | * To avoid that, you need to delay the execution until the pause menu is closed again. For example by: <sqf inline>(findDisplay 49) closeDisplay 0; diag_captureFrame 3;</sqf> | ||
* To have the console available in a mission (outside the [[Category:Eden_Editor|Eden editor]]), you need to enable it via the | * To have the console available in a mission (outside the [[Category:Eden_Editor|Eden editor]]), you need to enable it via the {{Link|Description.ext#enableDebugConsole}} parameter. | ||
* Alternatively you can enable the console in any missions via mods (see below). | * Alternatively you can enable the console in any missions via mods (see below). | ||
}} | }} | ||
Mods to enable console in any mission: | Mods to enable console in any mission: | ||
* | * {{Link|https://steamcommunity.com/sharedfiles/filedetails/2000114984|Enable Debug Console = 1 (Access - ADMIN)}} by Mr. Uplay | ||
* | * {{Link|https://steamcommunity.com/sharedfiles/filedetails/2000131738|Enable Debug Console = 2 (Access - ALL)}} by Mr. Uplay | ||
* | * {{Link|https://steamcommunity.com/sharedfiles/filedetails/1939811222|enableDebugConsole}} by Sams | ||
* | * {{Link|https://steamcommunity.com/sharedfiles/filedetails/1231625987|Debug Console}} by R3vo | ||
{{Feature|important| | {{Feature|important| | ||
For dedicated server use, you need to allow the given mod by uploading the respective bikey to the server's keys folder - or disable | For dedicated server use, you need to allow the given mod by uploading the respective bikey to the server's keys folder - or disable <syntaxhighlight lang="cpp" inline>verifySignatures = 0;</syntaxhighlight> via [[Arma 3: Server Config File|server.cfg]]. | ||
}} | }} | ||
'''Strongly recommended''': Use an enhanced debug console like | '''Strongly recommended''': Use an enhanced debug console like {{Link|https://steamcommunity.com/sharedfiles/filedetails/450814997|CBA_A3}} or {{Link|https://steamcommunity.com/sharedfiles/filedetails/281032552|DevCon}} mod | ||
3. Via custom action | 3. Via custom action | ||
Line 217: | Line 207: | ||
==== Slow Frame ==== | ==== Slow Frame ==== | ||
{{Feature|important|The '''scope''' parameter is [https://en.wikipedia.org/wiki/Case_sensitivity case sensitive].}} | |||
{{Feature|important| | |||
The '''scope''' parameter is [https://en.wikipedia.org/wiki/Case_sensitivity case sensitive] | |||
}} | |||
If you want to capture a snapshot of a slow frame, there are a few options: | If you want to capture a snapshot of a slow frame, there are a few options: | ||
1. Via | 1. Via {{Link|Arma 3: Cheats|Arma 3 Cheats}} | ||
# Press {{Controls|Shift|num-}} | # Press {{Controls|Shift|num-}} | ||
Line 285: | Line 272: | ||
==== Current Server Frame ==== | ==== Current Server Frame ==== | ||
If you want to capture a snapshot of a current moment on the server, there are a few options: | If you want to capture a snapshot of a current moment on the server, there are a few options: | ||
Line 313: | Line 299: | ||
Mods to enable console in any mission: | Mods to enable console in any mission: | ||
* | * {{Link|https://steamcommunity.com/sharedfiles/filedetails/?id=2000114984|Enable Debug Console {{=}} 1 (Access - ADMIN)}} by Mr. Uplay | ||
* | * {{Link|https://steamcommunity.com/sharedfiles/filedetails/?id=2000131738|Enable Debug Console {{=}} 2 (Access - ALL)}} by Mr. Uplay | ||
* | * {{Link|https://steamcommunity.com/sharedfiles/filedetails/?id=1939811222|enableDebugConsole}} by Sams | ||
* | * {{Link|https://steamcommunity.com/sharedfiles/filedetails/?id=1231625987|Debug Console}} by R3vo | ||
{{Feature|important| | {{Feature|important| | ||
Line 455: | Line 441: | ||
For customized server side logging use the '''remoteExec approach''' or '''console with remote/target execution'''. | For customized server side logging use the '''remoteExec approach''' or '''console with remote/target execution'''. | ||
== | |||
== Capture Reading == | |||
TODO | TODO | ||
Line 467: | Line 454: | ||
=== Externally === | === Externally === | ||
==== Perfetto UI Web Viewer ==== | ==== Perfetto UI Web Viewer ==== | ||
Pros: | Pros: | ||
* Can view a frame capture without Arma 3 running | * Can view a frame capture without Arma 3 running | ||
Line 478: | Line 464: | ||
* Navigation via mouse and keyboard not super intuitive - see '''Support - Keyboard shortcuts''' in the left side menu | * Navigation via mouse and keyboard not super intuitive - see '''Support - Keyboard shortcuts''' in the left side menu | ||
* Does not support viewing multiple frame captures (only via multiple tabs) | * Does not support viewing multiple frame captures (only via multiple tabs) | ||
* .trace JSON export from Arma 3 doesnt support more advanced features of Perfetto UI nor contains information on CPU-RAM use | * .trace JSON export from Arma 3 doesnt support more advanced features of Perfetto UI nor contains information on CPU-RAM use | ||
Website: https://ui.perfetto.dev | Website: https://ui.perfetto.dev | ||
{{Feature|important| | {{Feature|important|Only supports {{hl|.trace}} format frame captures!}} | ||
Only supports .trace format frame captures! | |||
}} | |||
==== Tracy Live Viewer ==== | ==== Tracy Live Viewer ==== | ||
Works only with the custom tracy version provided by Dedmen as part of the {{Link|https://steamcommunity.com/sharedfiles/filedetails/1652506957|Arma Script Profiler}} mod. | |||
{{Feature|informative|Capturing live data needs a lot of RAM - up to 2 GB per minute (depends on detail level captured).}} | |||
{{Feature|informative| | |||
Capturing live data needs a lot of RAM - up to 2 GB per minute (depends on detail level captured) | |||
}} | |||
Pros: | Pros: | ||
Line 521: | Line 502: | ||
* https://tracy.nereid.pl | * https://tracy.nereid.pl | ||
* https://github.com/wolfpld/tracy | * https://github.com/wolfpld/tracy | ||
== Scripting Commands == | == Scripting Commands == | ||
Line 526: | Line 508: | ||
* [[diag_captureFrame]] | * [[diag_captureFrame]] | ||
* [[diag_captureSlowFrame]] | * [[diag_captureSlowFrame]] | ||
* [[diag_logSlowFrame]] - not available in | * [[diag_logSlowFrame]] - not available in {{arma3}}. Since {{GVI|arma3|2.20}} [[diag_captureSlowFrame]] with '''toFile''' parameter can log to file as alternative. | ||
* [[diag_captureFrameToFile]] | * [[diag_captureFrameToFile]] | ||
Revision as of 13:36, 5 December 2024
Versions with performance profiling
The Profiling build is provided in semi regular intervals between major game version updates by Dedmen in tandem with Arma 3 Performance build.
The download and changelog can be found in the BI Forums as well as in the #perf_prof_branch channel in the official Arma 3 Discord server.
Setup
Sample batch file to auto rename the exe: replaceArma3exeWithProfiling.bat
cd /D "C:\Program Files (x86)\Steam\steamapps\common\Arma 3"
del arma3.exe
copy /Y /B arma3profiling_x64.exe arma3.exe
Steam Branch
AUTOMATIC (Recommended) - see also Steam Branches.
- Open Steam
- Right click on Arma 3 in your Steam Library, then Properties
- Select the tab betas
- Finally, use the dropdown list to select the branch profiling - Performance Profiling Build
- Wait for the download to finish
This will automatically download newest performance and profiling exes once they are available.
Google Drive
MANUAL (only when needed)
- Download and install 7z (usually the 64-bit Windows x64 variant)
- Open BI forum thread
- Got to latest post with a link to google drive
- Browse to the latest game version and profiling build version folder
- Download the desired exe from the google drive folder (usually the arma3client_x64_profiling_XXX.7z)
- Extract the 7z file and copy the exe to your game folder (usually C:
\Program Files (x86) \Steam \steamapps \common \Arma 3)
FPS Basics
The duration the engine needs to compute all calculations in one cycle is called a frame. The frame rate, or frames per second (FPS) states how many cycles the engine could compute for a given second.
FPS | seconds | milliseconds | fps sample | s sample | ms sample |
---|---|---|---|---|---|
1000 | 0.001 | 1 | diag_captureSlowFrame ["total", "1000fps"] | diag_captureSlowFrame ["total", "0.001s"] | diag_captureSlowFrame ["total", "1ms"] |
500 | 0.002 | 2 | diag_captureSlowFrame ["total", "500fps"] | diag_captureSlowFrame ["total", "0.002s"] | diag_captureSlowFrame ["total", "2ms"] |
333 | 0.003 | 3 | diag_captureSlowFrame ["total", "333fps"] | diag_captureSlowFrame ["total", "0.003s"] | diag_captureSlowFrame ["total", "3ms"] |
250 | 0.004 | 4 | diag_captureSlowFrame ["total", "250fps"] | diag_captureSlowFrame ["total", "0.004s"] | diag_captureSlowFrame ["total", "4ms"] |
200 | 0.005 | 5 | diag_captureSlowFrame ["total", "200fps"] | diag_captureSlowFrame ["total", "0.005s"] | diag_captureSlowFrame ["total", "5ms"] |
100 | 0.010 | 10 | diag_captureSlowFrame ["total", "100fps"] | diag_captureSlowFrame ["total", "0.010s"] | diag_captureSlowFrame ["total", "10ms"] |
60 | 0.017 | 17 | diag_captureSlowFrame ["total", "60fps"] | diag_captureSlowFrame ["total", "0.017s"] | diag_captureSlowFrame ["total", "17ms"] |
50 | 0.020 | 20 | diag_captureSlowFrame ["total", "50fps"] | diag_captureSlowFrame ["total", "0.020s"] | diag_captureSlowFrame ["total", "20ms"] |
40 | 0.025 | 25 | diag_captureSlowFrame ["total", "40fps"] | diag_captureSlowFrame ["total", "0.025s"] | diag_captureSlowFrame ["total", "25ms"] |
30 | 0.033 | 33 | diag_captureSlowFrame ["total", "30fps"] | diag_captureSlowFrame ["total", "0.033s"] | diag_captureSlowFrame ["total", "33ms"] |
20 | 0.050 | 50 | diag_captureSlowFrame ["total", "20fps"] | diag_captureSlowFrame ["total", "0.050s"] | diag_captureSlowFrame ["total", "50ms"] |
10 | 0.100 | 100 | diag_captureSlowFrame ["total", "10fps"] | diag_captureSlowFrame ["total", "0.100s"] | diag_captureSlowFrame ["total", "100ms"] |
5 | 0.200 | 200 | diag_captureSlowFrame ["total", "5fps"] | diag_captureSlowFrame ["total", "0.200s"] | diag_captureSlowFrame ["total", "200ms"] |
4 | 0.250 | 250 | diag_captureSlowFrame ["total", "4fps"] | diag_captureSlowFrame ["total", "0.250s"] | diag_captureSlowFrame ["total", "250ms"] |
3 | 0.333 | 333 | diag_captureSlowFrame ["total", "3fps"] | diag_captureSlowFrame ["total", "0.333s"] | diag_captureSlowFrame ["total", "333ms"] |
2 | 0.500 | 500 | diag_captureSlowFrame ["total", "2fps"] | diag_captureSlowFrame ["total", "0.500s"] | diag_captureSlowFrame ["total", "500ms"] |
1 | 1.0 | 1000 | diag_captureSlowFrame ["total", "1fps"] | diag_captureSlowFrame ["total", "1.0s"] | diag_captureSlowFrame ["total", "1000ms"] |
Duration Parameter
- The duration parameter is a time measured in seconds. 0.3 (seconds) is the same as 300 ms / milliseconds.
- It is used to determine what duration of a frame you consider abnormal or that you are interested in for other reasons.
- The first time such frame happens, the frame information will be captured - or put differently: when a situation occurs with a frame lasting longer than said duration.
- 0.3 (<3 fps for the whole frame) is definitely something you should not see in a normal game.
- If you do not capture any frames with 0.3, try lowering it to 0.2 (200 ms / <5 fps) or 0.1 (100 ms / <10 fps).
- If it triggers "too early" before the main slowdown happens that you want to analyze, increase it to a higher value, e.g. 1.0 for long freeze (<1 fps).
Scope Parameter
- total is name for the scope of the duration for the whole frame (sLoop on a dedicated server, cLoop on a headless client).
- With the total scope you capture more or less your frames per second (fps) - if your current frame-rate is essentially stable. In other words if all frames for that second have roughly similar duration.
- In some situations you may encounter single/few frame lasting mini-freezes - aka one/few frames take rather long to complete (ie 100 ms), yet the rest remains in your normal fps range (20 ms for 50 fps for example).
- Whereas a longer freeze means usually a frame last very long, like a second or longer. Thus the game stalls altogether for the given timeframe.
- The scope parameter now allows you to capture subparts of a frame, of different parts of the engine computation - in general terms like networking, world and unit simulation, AI behavior, sound, rendering and visibility checks.
- The total scope is also from the main thread and could be called main frame - all things the engine has to complete in a cycle. In addition there are other threads, where the engine moves other tasks to be computed alongside. Essentially this is what multi-threading is about, allowing the CPU with multiple cores to compute more things at the same time, and thus to reduce the duration of the main frame.
- With the scope parameter you can capture said subparts from the "main frame", yet also from the so called "worker" threads.
- The names for scopes/subscopes you can get from the diag capture dialog or in the frame capture logging files (.log/.trace).
How to Capture
Client
Current Frame
If you want to capture a snapshot of a current moment, there are a few options:
1. Via Arma 3 Cheats
- Press ⇧ Shift + NUM -
- Type frame
- As result the diag capture dialog opens
2. Via Debug Console
- Open the console (ESC key to open pause menu or ⇧ Shift + D in the)
- Execute diag_captureFrame 1;
- As result the diag capture dialog opens
Mods to enable console in any mission:
- Steam File 2000114984 by Mr. Uplay
- Steam File 2000131738 by Mr. Uplay
- enableDebugConsole by Sams
- Debug Console by R3vo
Strongly recommended: Use an enhanced debug console like CBA_A3 or DevCon mod
3. Via custom action
You need to execute in the console the following code first to add the action:
To remove the action again:
4. Via mission specific code
Slow Frame
If you want to capture a snapshot of a slow frame, there are a few options:
1. Via Arma 3 Cheats
- Press ⇧ Shift + NUM -
- Type sframe
- Once the game falls below 30 fps (30 ms / 0.030 (s) duration for for total scope) the diag capture dialog opens
2. Via Debug Console
- Open the console (ESC key to open pause menu or ⇧ Shift + D in the)
- Execute diag_captureSlowFrame ["total", 0.03];// [scope, duration]
- As result the diag capture dialog opens
3. Via custom action
You need to execute in the console the following code first to add the action:
Customize the scope and duration as desired.
To remove the action again:
4. Via mission specific code
Server
Current Server Frame
If you want to capture a snapshot of a current moment on the server, there are a few options:
1. Via Admin chat commands
- Open the chat window by pressing the chat key (default /).
- Type #captureFrame
- The current frame on the server is captured and written to a log file in the same directory as the .rpt file.
2. Via Debug Console
- Open the console (ESC key to open pause menu)
- Execute [1] remoteExec ["diag_captureFrame", 2];
- As result the diag capture dialog opens
Mods to enable console in any mission:
- Enable Debug Console = 1 (Access - ADMIN) by Mr. Uplay
- Enable Debug Console = 2 (Access - ALL) by Mr. Uplay
- enableDebugConsole by Sams
- Debug Console by R3vo
Strongly recommended: Use an enhanced debug console like CBA_A3 or DevCon mod
3. Via custom action
You need to execute in the console the following code first to add the action:
To remove the action again:
4. Via mission specific code
Slow Server Frame
If you want to capture a snapshot of a slow frame on the server, there are a few options:
1. Via Admin chat commands
- Open the chat window by pressing the chat key (default /).
- Type #captureSlowFrame sLoop 0.03 0 1 - parameters scope, threshold, frameOffset, numberOfSlowFrames to capture
- Captures one frame on the server if it exceeds the set threshold in seconds for the given scope (30 ms / 0.030 (s) duration for for sLoop scope)
- The frame information get written to a log file in the same directory as the .rpt file
2. Via Debug Console
- Open the console (ESC key to open pause menu)
- Execute [["sLoop", 0.03]] remoteExec ["diag_captureSlowFrame", 2]; // [scope, duration]
- As result the diag capture dialog opens
3. Via custom action
You need to execute in the console the following code first to add the action:
Customize the scope and duration as desired.
To remove the action again:
4. Via mission specific code
Storing a capture to file
To export the gathered information of a capture for later analysis/review or to share it with others, you have the following options:
Diag capture dialog
- Press the Copy All button
- Open an external text editor
- Paste the text into a new text/log file
- Save the file (as .txt or .log)
diag_captureSlowFrame
The sqf command diag_captureSlowFrame has the boolean toFile as forth parameter. In addition with the Number continuousCounter as fifth parameter you can make it log multiple captures in one go.
[section, threshold, frameSkip, toFile, continuousCounter]
- Client: diag_captureSlowFrame ["total", 0.03, 0, true, 1];
- Server: [["total", 0.03, 0, true, 1]] remoteExec ["diag_captureSlowFrame", 2];
Dedicated server
The Admin chat commands #captureFrame / #captureSlowFrame sLoop 0 will automatically create both .log and .trace format files on the server in the rpt log folder. See above server section for more information.
For customized server side logging use the remoteExec approach or console with remote/target execution.
Capture Reading
TODO
Ingame
- In the window you will be able to browse a lot of performance-related data, which can be interesting
TODO
Externally
Perfetto UI Web Viewer
Pros:
- Can view a frame capture without Arma 3 running
- Nice visualization
- Sub scopes easier to identify
Cons:
- Fairly slow to load/display a frame capture
- Navigation via mouse and keyboard not super intuitive - see Support - Keyboard shortcuts in the left side menu
- Does not support viewing multiple frame captures (only via multiple tabs)
- .trace JSON export from Arma 3 doesnt support more advanced features of Perfetto UI nor contains information on CPU-RAM use
Website: https://ui.perfetto.dev
Tracy Live Viewer
Works only with the custom tracy version provided by Dedmen as part of the Arma Script Profiler mod.
Pros:
- Live frame capture
- Multiple frame captures - see frame by frame
- Statistics like number of executions, average and mean time execution
- Selection of zones for specific analysis of any time frame
- Profiling of unscheduled code. See: ArmaScriptProfiler
Cons:
- Fairly advanced
- Tracy UI more functional than visually nice
Required mods:
- CBA_A3: https://steamcommunity.com/workshop/filedetails/?id=450814997
- Arma Script Profiler: https://steamcommunity.com/sharedfiles/filedetails/?id=1652506957
- Intercept Minimal Dev: https://steamcommunity.com/workshop/filedetails/?id=1645973522
Extra startup parameters: -profilerEnableEngine -profilerEngineThreads "-mod=!Workshop\@CBA_A3;!Workshop\@Arma Script Profiler;!Workshop\@Intercept Minimal Dev"
- How to use: https://github.com/dedmen/ArmaScriptProfiler/wiki
- Additional command line parameters: https://github.com/dedmen/ArmaScriptProfiler/wiki/Command-line-parameters
- Some more info at: https://forums.bohemia.net/forums/topic/211626-arma-script-profiler/
- Source: https://github.com/dedmen/ArmaScriptProfiler
- Discord for tech support and such: https://discord.gg/vbFje5B
Advanced info:
Scripting Commands
- diag_captureFrame
- diag_captureSlowFrame
- diag_logSlowFrame - not available in Arma 3. Since 2.20 diag_captureSlowFrame with toFile parameter can log to file as alternative.
- diag_captureFrameToFile
Creating Your Own Subtree
When Profiling Per-Frame Eventhandlers (PFH), diag_captureFrame only shows one blob called siFEH that contains all PFH's so you can't see what part of that is caused by your PFH.
You can create your own subtree inside siFEH by wrapping your function call inside a isNil CODE statement like this:
Turn your old call which may look like this:
Into something like this:
Now when you run diag_captureFrame inside of siPFH you will have a subtree called gsEva and behind that you can see the first line of code inside the isNil statement.
It will only show a part of the first line of that code so you should put something descriptive into the isNil statement.
You can use the same to create a subtree for any function you like. This will also work inside Scheduled (spawned) scripts.
But using this method to "subtree" a function with return values requires a little bit of trickery to get the return value out.