#Revising Arma 3 Profiling Page

1 messages · Page 1 of 1 (latest)

last steppe
safe vessel
#

https://community.bistudio.com/wiki/diag_captureSlowFrame
new parameters
bool toFile (if true, doesn't open UI and writes straight to file, note that even if false it might still force to file if it doesn't have a UI, like a server or HC)
scalar continuousCounter (Captures N slow frames. Can be aborted by running diag_captureFrame or another captureSlowFrame)

https://community.bistudio.com/wiki/diag_logSlowFrame
Fixed. infinitely captures every slow frame, can be cancelled by running diag_captureFrame or diag_captureSlowFrame.

Somewhere, chrome export format.
Capturing to file, also creates a .trace file, which can be imported into chrome://tracing (in chromium based webbrowsers), or https://ui.perfetto.dev/
The same format can be exported by pressing the "COPY ALL" button, in the capture frame UI, with CTRL key being held down

stuck hawk
last steppe
#

Yes

last steppe
#

@safe vessel Question:

What is the difference between doing profiling with arma3diag_x64.exe vs with arma3profiling_x64.exe?

stuck hawk
#

diag = development tools
profiling = performance measurement
i'd say
there is some overlap of diag commands, and some only available in either one afaik

last steppe
#

Yeah, now I am not wiser 😄

last steppe
#

I know

safe vessel
#

I don't think there is any difference

#

why would there be one

last steppe
#

Thank you

last steppe
safe vessel
#

Yes. Because we cannot play diag exe in multiplayer on stable servers.

last steppe
#

So profling exe is a dumped down version of diag with profiling commands so that it works in mp?

stuck hawk
#

ie diag exportTerrainSVG is not in profiling, and all others that would create problems in a branch you can use for MP play

last steppe
#

Would you agree if I say for profiling use the profiling.exe because it is closer to the stable.exe performance wise?

stuck hawk
#

you have to use that exe as only that has the internal labels active for profiling (plus a few exclusive sqf commands afaik - checking that atm)

last steppe
#

Is has the labels? I thought that was internal.exe only?

stuck hawk
#

at least i would assume the engine only sets theses in certain exe - not all the time

#

as it creates a (probably small but still) overhead

#

ok diag.exe has also the profiling sqf commands in

last steppe
#

So what's the conclusion? Diag.exe or profiling.exe?

stuck hawk
#

well in general perf branch is updated more often, plus not everything goes into the dev branch

stuck hawk
#

third point isnt necessarily true

#

overall the guide probably should start with motivation and target audience

#

there is broadly speaking:
a) to optimize sqf coding (and to some extent missions)
b) identify engine coding that may have optimization potential (aka identified by anyone but so far only addressable by Dedmen)

safe vessel
safe vessel
safe vessel
safe vessel
stuck hawk
#

well i guess the statement is OK. however it depends on the purpose / goal - for some instances you may want to have the additional diags available while profiling but probably a rare case. looking at those available https://community.bistudio.com/wiki/Arma_3:_Diagnostics_Exe potentially in combination with PX, AI, particles and a few others it could make sense

it seems diag exe also creates the debug.log - wasnt aware of that/forgot. so the additional logging makes it slower. beyond that isnt it mostly slower only if you have a particular diag command activated. at least i'd assume its mostly behind a bool check. yet if the engine has to do more work all the time, then its slower no doubt

stuck hawk
safe vessel
#

The profiling scopes are set for profiling builds

#

beyond that isnt it mostly slower only if you have a particular diag command activated
No. diag has alot more checks (asserts) that are always active, no matter of diag commands.
Every interaction with an array for example, is slower.

last steppe
#

The same format can be exported by pressing the "COPY ALL" button, in the capture frame UI, with CTRL key being held down
@safe vessel Is this already available?

safe vessel
#

no

last steppe
#

Ok

stuck hawk
#

for example profiling sqf code (schedule and unscheduled) you cant really with the current internal tools - mainly lacking is the ability to define scope labels to get picked up for visualization or data logging

#

what you have right now (from what i understand) is:

  1. siScr is scheduled code - without labels for scopes its not really workable, plus its not picking up everything i think
  2. siFEH is unscheduled code from perFrame eventhandlers [maybe more] (others like draw/draw3d etc would be in other simulation scopes afaik) - however also here the exposed info and completeness is too lacking
#

for unscheduled there is https://forums.bohemia.net/forums/topic/211626-arma-script-profiler/ - it can define scopes/labels, and using external viewers is quite powerful. the interface of external viewers is fairly complex, thus would also need a guide/use case descriptions

#

Capturing to file, also creates a .trace file, which can be imported into chrome://tracing (in chromium based webbrowsers), or https://ui.perfetto.dev/
these will need exploration on that

#

as for engine (non sqf) profiling - the internal viewer is usable, if you understand the general principle of engine computation cycles, and some idea of the parts and it subparts (this is where a table with important scopes/labels will be quite important)

external viewers probably still better - functionality wise for sure; UI/interface wise depends/to be seen

last steppe
#

Yeah. I want to just quickly explain the intern viewer, but the external one is probably the one everyone should use.

stuck hawk
#

in terms of profiling approach for that - i think there is two approaches basically:

  1. looking for a specific "problem" (going by the profiling visualization or from a suspected observed issue trying to narrow it down with repro steps)
  2. broad statistically data logging and filtering to determine a) frequent "slow parts" or b) "extreme slow parts" - that approach would need probably a combination of custom tool made by the community (for filtering and data storage) and custom or third party for visualization (maybe grafana)
#

Enable server performance logging with the #monitords <seconds> command,
Load the resulting server log file using the button below.

#

cant find a sample image atm

#

Server load: FPS DDD, memory used: DDD MB, out: DDD Kbps, in: DDD Kbps, NG:0, G:DDD, BE-NG:0, BE-G:0, RQ:0, Players: 1 (L:0, R:0, B:0, G:0, D:1)

#

monitorDS data is a lot more simple, yet graph visualization is quite important to understand data

#

ie to hide/filter irrelevant data is quite essential to easily see the relevant parts

#

would be good to get some other community members involved that either used the internal tools, or external profiling tools - there may easily be different approaches or little but important things to know (in terms of approach/workflow/features/tools/etc)

#

ie on the bottom left you can switch to averages and sums (default tree view)

#

the visualization isnt working for the other two, but the sorted display can be useful

#

another likely impactful change will be the increased MT Dedmen has been working on. this will add a different layer to profiling analysis (but may not be really relevant/understandable without engine access)

stuck hawk
#

@last steppe should i start posting some stuff, or better do the meet-up first?

last steppe
#

Sure Go ahead

stuck hawk
#

important: https://ui.perfetto.dev/ doesnt accept .trace/.any files with UTF-8 BOM - must be Windows-1252 encoding (may happen if you paste the data into a new text file)

last steppe
#

I tried with a new .txt and it wored. Weird.

stuck hawk
#

depends on your text/code editor whats default. UTF-8 is for international character set

stuck hawk
#

so lets start:

stuck hawk
#

Options to capture:

  1. cheats: https://community.bistudio.com/wiki/Arma_3:_Cheats#FRAME
  • capture on client only
  • current frame + low frame
  • no customization for low frame
  • UI only - no (direct) data logging
  1. chat commands: https://community.bistudio.com/wiki/Multiplayer_Server_Commands#Performance_profiling
  • capture on server only
  • current frame + low frame
  • with customization for low frame - with continuousCounter available (capture multiple cases)
  • only data logging
  1. sqf commands (ie via console): https://community.bistudio.com/wiki/diag_captureFrame + https://community.bistudio.com/wiki/diag_captureSlowFrame
  • both for client and server side capture
  • current frame + low frame
  • with customization for low frame - for client option for UI or to file, plus continuousCounter available (capture multiple cases)
  • for client option for UI or to file
  1. Arma Script Profiler: https://steamcommunity.com/sharedfiles/filedetails/?id=1652506957
#

ASP is currently not working yet with latest profiling branch

#

ASP is the only to profiling unscheduled code

#

Visualization options: [WIP]

  1. Ingame - https://community.bistudio.com/wiki/Performance_Profiling

How to open:

  • a) Cheats (frame/sframe)
  • b) sqf commands (ie von console) (diag_captureFrame/diag_captureSlowFrame)

Data import:

  • a) from cheats/sqf commands directly
  • b) via "paste all" button (ie from captureFrame-ID-DATE.NUMBER.log created by chat commands on the server or toFile logging of diag_captureSlowFrame [or saved/shared logs])
  1. External - perfetto: https://ui.perfetto.dev/#!/viewer

Data import: (.trace)

  • a) created by chat commands on the server
  • b) toFile logging of diag_captureSlowFrame
  • c) via "copy all" button while holding shift and then pasting into a text file renaming from .txt to .trace
  1. External - tracy: https://tracy.nereid.pl/
safe vessel
#

but not (yet?) continuousCounter available (capture multiple cases)
Starting with prof v6

last steppe
stuck hawk
#

checking

#

not sure - depends on the goals i guess
like i'd say almost everyone only needs to know the important ones (that take relevant computation time) - if you look for say minifreezes, you would need to know others
the other part is the subscope layering is quite relevant
in general a basic list is still useful - if to be done alphabetically, or grouped in some way (per "main scope"/etc) to be determined

last steppe
#

My idea was to fill the important one with some information so ppl can lookup what they mean.

stuck hawk
#

better to have than not to have for sure. just the goal shouldnt be to fill all/at much as possible

last steppe
#

Well, the list is there now so we at least have a place to put things if we find something interesting

stuck hawk
#

maybe group at least by main scopes (via separate tables, or in order, or having a colum for "main scope")

last steppe
#

I can only group them how they are shown in the UI.

#

Won't do any manual grouping

stuck hawk
#

well you can take the main scope from the UI [network, sim, sound, ai, render, vis] (and probably have non main thread ones also separate)

#

or otherwise grab the main ones from the log

#

well also a little tricky

#

can you grab from UI when sorted by duration?

last steppe
#

I can grab everything thats in the tree view

stuck hawk
#

also just to make sure - not all scopes are always shown, plus the UI shows less than in the logs

#

so if you switch to averages and the other via the button it grabs them correctly?

last steppe
#

Maybe

safe vessel
#

I had something in mind last night that I wanted to write here. Sadly I have forgotten.

#

Ah! The. Thing. Eh.
Yes, how to run profiling exe. Because you need to swap the exe files, or you need to rename to profiling one to the 32bit one, so when you launch 32 bit in launcher, it'll run the profiling one.

Basically somewhere on wiki should describe how to actually run the profiling exe with mods

last steppe
#

Yeah good point.

stuck hawk
#

alternative (especially if you want different startup params)

  1. start via a3 launcher the desired setup
  2. open rpt. copy the startup line
  3. paste into a new .bat file
  4. rename exe filename in the bat to profiling
safe vessel
#

only works if RPT has the full startup line.
With many mods, it most likely doesn't

stuck hawk
#

true. however profiling with many mods..