Changes between Version 7 and Version 8 of Profiler2


Ignore:
Timestamp:
Jan 29, 2021, 4:08:17 PM (22 months ago)
Author:
Langbart
Comment:

adding a table of contents

Legend:

Unmodified
Added
Removed
Modified
  • Profiler2

    v7 v8  
     1[[TOC]]
     2
    13= Using Profiler2 for profiling =
    24Profiler2 is 0 A.D.'s advanced profiler. It is defined for very finely grained profiling, since it can measure events down to every single occurrence. A simple use of Profiler 2 would be to detect frame rate spikes or measure absolute performance improvements over a simulation turn.
    35
    4 == Creating a Profiler2 file ==
    5 === non-visual replay (command line) ===
     6== Creating a profiler2.jsonp file ==
     7=== Non-visual replay (command line) ===
    68You will need a replay file (command.txt) that you can create yourself or get from someone else, make sure it is compatible with your Alpha version. When you run the following command, a ''profiler2.jsonp'' file is automatically created in your working directory (~/0ad).
    79
     
    1113Non-visual replay is also '''recommended''' if you want to compare two different states of your working copy with the same replay file. This ensures that your two ''.jsonp'' files are in sync and can be better compared using the ''source/tools/profiler2/profiler2.html'' file.
    1214
    13 === visual replay (game interface) ===
     15=== Visual replay (game interface) ===
    1416By default, profiler2 is not enabled. To see the results, you need to enable the HTTP server. You can do this by setting the following configuration in your user.cfg file: "profiler2.autoenable = true". Alternatively, you can press Ctrl+F11 (by default) to activate the HTTP profiler in-game. Currently, enabling Profiler2 in replay mode can only be done by recompiling the game with the following patch:
    1517
     
    3133Once the HTTP server is enabled, you simply need to open ''source/tools/profiler2/profiler2.html'' in a modern web browser. You should see that the " Live" report is loaded. If you don't have HTTP profiler enabled, nothing will be displayed, otherwise you should get a screen with a timeline of frames and events. You can save report sessions by clicking "Save Live Report to file". This will save the file to your log folder instead of your working directory as with non-visual replay. If you do this over a few runs, you can get several report files to compare.
    3234
    33 == Comparing reports ==
    34 You can easily compare multiple runs using the ''source/tools/profiler2/profiler2.html'' file by loading multiple profiling reports. Load them in the interface and click on some of the events. The graphs will then show you the event for all the reports so you can easily compare them. You will also get a table recapitulating some information to help you decide if an optimisation is worth it.
    35 
    36 [[Image(https://trac.wildfiregames.com/raw-attachment/wiki/Profiler2/compare-reports.PNG, 800px, border=2)]]
    37 
    38   ==
    39 
    40 == The Report interface ==
     35== Interface and comparison ==
     36=== The Report interface ===
    4137Profiler can give you a very detailed view of the game.[[BR]]
    4238
     
    4945Profiler2 allows you to open several reports (even in addition to the live report). You can open older profiling run using the top button. If you have several reports open, you can select the one you which to examine by clicking on it.
    5046
    51 == The Analysis interface ==
     47=== The Analysis interface ===
    5248The lower part of the screen shows you useful graphs. On the "choices" panel, you will see a list of all profiled events. If you click on one or more of these events, you will get 2 graphs showing you information.
    5349
     
    6460The frame-by-frame graphs shows you how long an event took frame-by-frame, which can be used along with the report timelines to find out precisely what frames are slow and thus what causes the slowness.
    6561
    66 = Choosing what you wish to profile =
     62=== Comparing reports ===
     63You can easily compare multiple runs using the ''source/tools/profiler2/profiler2.html'' file by loading multiple profiling reports. Load them in the interface and click on some of the events. The graphs will then show you the event for all the reports so you can easily compare them. You will also get a table recapitulating some information to help you decide if an optimisation is worth it.
     64
     65[[Image(https://trac.wildfiregames.com/raw-attachment/wiki/Profiler2/compare-reports.PNG, 800px, border=2)]]
     66
     67== Choosing what you wish to profile ==
    6768This part requires you to change the c++ and recompile the game.
    6869