Changes between Version 5 and Version 6 of EngineProfiling


Ignore:
Timestamp:
Jun 23, 2013, 2:24:14 PM (11 years ago)
Author:
Yves
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • EngineProfiling

    v5 v6  
    6868== Simulation replay mode ==
    6969
    70 If you're not measuring graphics or GUI code, replay mode lets you run the simulation (the gameplay code and scripts and the AI etc) at maximum speed with all graphics disabled. This should be fully deterministic (i.e. you'll get the same results on each run) and doesn't need user interaction (so you can easily run in Valgrind).
     70If you're not measuring graphics or GUI code, replay mode lets you run the simulation (the gameplay code and scripts and the AI etc) at maximum speed with all graphics disabled. This should be fully deterministic (i.e. you'll get the same results on each run) and doesn't need user interaction (so you can easily run in Valgrind). It even allows you to create nice graphs for comparing the performance before and after your changes!
    7171
    7272First, play the game normally, in either single-player or multiplayer. It will generate a file `sim_log/${PID}/commands.txt` in the game's logs path (see GameDataPaths) based on the process ID; looking for the newest directory should find it. This contains the map setup data and a list of all players' inputs, so the game can be replayed. You might want to copy the `commands.txt` to somewhere memorable.
     
    7878(or something equivalent on Windows). It will print its status to `stdout` (or the Output window on Windows). It gives the MD5 checksum of the complete simulation state once it's finished, which is handy if you're changing the code and want to make sure you're not affecting the simulation behaviour. Run in a profiler to measure whatever you want to measure.
    7979
    80 It also stores the in-game profiler state in `profile.txt` every 20 turns. There's a script in `source/tools/replayprofile/` which can plot a graph from that file.
     80=== Creating graphs ===
     81The replay mode also stores the in-game profiler state in `profile.txt` every 20 turns. There's a script in `source/tools/replayprofile/` which can plot a graph from that file.
     82
     831. Check source/tools/replayprofile/extract.pl if it points to the right profile.txt (you can also change it to point to another working copy, but remember not to accidentally commit this change later)
     841. Optionally apply the [http://trac.wildfiregames.com/attachment/wiki/EngineProfiling/filter_data.diff attached patch] and define a filter for some of the events (again, don't commit your changes!)
     851. Run perl extract.pl > data.js
     861. Optionally make a second measurement for your modified code using the same commands.txt and extracting the data to data_1.js
     871. Optionally copy and paste lines from data_1.js to data.js and give them a sensible name (of course you can paste as many lines from as many other data files as you want)
     881. Open graph.html
     89
     90It will look similar to this:[[BR]]
     91[[Image(profile_24_1.gif, 25%)]]
     92
    8193
    8294== Valgrind ==