Script Profiling – Arma Reforger

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page creation)
 
(Remove External Profiler possibility)
 
Line 6: Line 6:
Enable the in-game profiler from the {{hl|[[Arma Reforger:Diag Menu|Diag Menu]] > Statistics > Script Profiler}} - the value can be set to {{hl|frame}} or {{hl|continuous}}.
Enable the in-game profiler from the {{hl|[[Arma Reforger:Diag Menu|Diag Menu]] > Statistics > Script Profiler}} - the value can be set to {{hl|frame}} or {{hl|continuous}}.


 
<!-- nope, sorry!
== External Profiler ==
== External Profiler ==


Line 15: Line 15:


In the profiler tool look for the "Scr::" prefix, or expand "#Main thread" in the stack view.
In the profiler tool look for the "Scr::" prefix, or expand "#Main thread" in the stack view.
 
-->


== Memory Allocation ==
== Memory Allocation ==

Latest revision as of 16:28, 27 April 2023

Script Profiling allows to profile script performance while it is running.


In-Game Profiler

Enable the in-game profiler from the Diag Menu > Statistics > Script Profiler - the value can be set to frame or continuous.


Memory Allocation

It is possible to dump all allocations from script:

  • Run the game with the -checkInstance startup parameter
  • Call the following from script: DumpInstances(/* bool csvFormatting = */ true);
  • This outputs memory allocations in the logs to the CSV format
    ==== Script allocations (script side) ====
    count,class,file,line,method
    144,array<@AnimSoundEvent>,scripts/3_Game/InventoryItemType.c,16,LoadSoundEvents
    1,ActionEatTetracyclineAntibiotics,scripts/4_World/Classes/UserActionsComponent/ActionConstructor.c,123,ConstructActions
    1,Wetness,scripts/4_World/Classes/PlayerNotifiers/NotifiersManager.c,19,NotifiersManager
    55,map<string,@WidgetCacheObject>,scripts/5_Mission/GUI/WidgetCacheObject.c,16,WidgetCacheObject
    1,Param1<int>,scripts/3_Game/tools/UtilityClasses.c,24,Init
    1,CraftGhillieTop,Scripts/4_World/Classes/Recipes/Recipes/_RecipeList.inc,11,CreateAllRecipes
    1,array<@Param>,scripts/4_World/Plugins/PluginBase/PluginItemDiagnostic.c,23,PluginItemDiagnostic
    861,array<SoundObjectBuilder>,scripts/3_Game/DayZAnimEventMaps.c,34,LoadTable