Jump to content
Sign in to follow this  
xendance

Performance debugging

Recommended Posts

I noticed that there are some threads about this for ArmA 2/OA, but I was wondering if there are any built in tools/commands to see if there are any hotspots in the code, how much time is spent updating game logic and how much is the current frametime and such. Are there any tools for that or am I out of luck?

Edit: Or something like the stat commands for UE 3 http://udn.epicgames.com/Three/StatsDescriptions.html

Share this post


Link to post
Share on other sites

There are a few. I've built a simple timer method in my script library to manually target possible trouble areas, along with some other tools, that you might find useful (link in my footer..). Otherwise there are some documented commands in the wiki, but it states that most are for specific builds of ARMA 2 - I havent tried these out..

http://community.bistudio.com/wiki/diag_captureSlowFrame

http://community.bistudio.com/wiki/diag_logSlowFrame

http://community.bistudio.com/wiki/diag_fpsmin

http://community.bistudio.com/wiki/diag_captureFrame

an overview can be found here

http://community.bistudio.com/wiki/Performance_Profiling

I am also interested so let me know how you go!

Share this post


Link to post
Share on other sites

Those functions don't seem to do anything. Considering they're void functions (ie no return value), I assume they'd show some kind of output on the UI? Or do they log into some file?

Share this post


Link to post
Share on other sites

Yeah looks they were only for a specific ARMA 2 debug builds, hopefully they will release a debug version of A3, probably not in alpha though I guess. You'll be limited to manual timing I guess, I built my little timer

using http://community.bistudio.com/wiki/diag_tickTime

Share this post


Link to post
Share on other sites

What are you looking for exactly?

I don't know about any robust performance meters. I've been doing the work by myself, using these two little tools.

1. Performance timer: I use this to measure how much time a function or a command cost. Yes, before creating a function, I run all my ideas through this, and after a while you will learn what are the most expensive operations.

_sstart = diag_tickTime;
for "_c" from 1 to 100 do  //this runs the code a 100 times. Change it as you want
{    
   //paste your code here
};
_eend = diag_tickTime;
player sideChat format ["%1",_eend - _sstart];

2. Script performance meter: the other hot spot you need to watch in a scripted Arma mission is script delay. This happens, when too much commands are queued. This script measures, if a 1 second sleep is really 1 second. With code causing congestion it can go up to tens of seconds.

Run this in a new thread (spawn or execVM)

_last = diag_tickTime;
while {true} do
{
 sleep 1;
 player sidechat format ["Slept %1 seconds", diag_tickTime - _last];
 _last = diag_tickTime;
};

Share this post


Link to post
Share on other sites

You can also check out the function BIS_fnc_codePerformance as well (you can find it in the functions viewer). It takes the following parameters:

Parameter(s):

_this select 0: STRING - tested expression

_this select 1 (Optional): ANY - Param(s) passed into code (default: [])

_this select 2 (Optional): NUMBER - Number of cycles (default: 10000)

Share this post


Link to post
Share on other sites
What are you looking for exactly?

I don't know about any robust performance meters. I've been doing the work by myself, using these two little tools.

1. Performance timer: I use this to measure how much time a function or a command cost. Yes, before creating a function, I run all my ideas through this, and after a while you will learn what are the most expensive operations.

_sstart = diag_tickTime;
for "_c" from 1 to 100 do  //this runs the code a 100 times. Change it as you want
{    
   //paste your code here
};
_eend = diag_tickTime;
player sideChat format ["%1",_eend - _sstart];

2. Script performance meter: the other hot spot you need to watch in a scripted Arma mission is script delay. This happens, when too much commands are queued. This script measures, if a 1 second sleep is really 1 second. With code causing congestion it can go up to tens of seconds.

Run this in a new thread (spawn or execVM)

_last = diag_tickTime;
while {true} do
{
 sleep 1;
 player sidechat format ["Slept %1 seconds", diag_tickTime - _last];
 _last = diag_tickTime;
};

What am I looking for? Well, anything. From script performance profiling to rendering profiling. I've been considering making a map for ArmA 3 if the tools are any good, and stats related to rendering would be nice too.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×