HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.03k stars 648 forks source link

[server] Add define to see what modules trigger most invalidation #11616

Open kLabz opened 3 months ago

kLabz commented 3 months ago

Compiling (note: this also works for display requests) with -D dump-invalidation-stats (X = 1) or -D dump-invalidation-stats=X will generate a dump/[target]/invalidation_stats.dump file with some data about how many modules are being invalidated because of a given module.

Modules are sorted by the total column (DESC), with their dependency tree indented. Modules for which direct = total are not displayed.

Example (partial) output with X = 10:

module                                         | direct |  total |
------------------------------------------------------------------
battle.skill.SkillEval                         |     12 |    425 |
  battle.skill.ScriptedSkill                   |      1 |    407 |
    battle.Battle                              |     15 |    406 |
      st.Group                                 |     25 |    391 |
        ent.Place                              |     23 |    359 |
          st.Item                              |     79 |    334 |
            ent.Player                         |     27 |    248 |
              ent.Entity                       |     30 |    220 |
                ent.UnitView                   |      1 |    187 |
                  prefab.Npc                   |      5 |    186 |
battle.Battle                                  |     15 |    424 |
  st.Group                                     |     25 |    409 |
    ent.Place                                  |     23 |    377 |
      st.Item                                  |     79 |    352 |
        ent.Player                             |     27 |    266 |
          ent.Entity                           |     30 |    238 |
            ent.UnitView                       |      1 |    205 |
              prefab.Npc                       |      5 |    204 |
                Game                           |    179 |    197 |
                  Const                        |      3 |      4 |
                  prefab.BattleSnow            |      1 |      4 |
                  prefab.BattleDithering       |      1 |      2 |
...

cc @ncannasse -- not sure how well that fits your needs, can adjust