[1.2][1.1][1.0] HarmonyProfiler - Profile your mods or modpacks

Started by mospidatru, February 19, 2020, 05:29:27 PM

Previous topic - Next topic

mospidatru

HarmonyProfiler
Need some code refactoring but all features work fine. And sorry for my bad english  :)

For example (on my low cpu 3 x 3ghz):
In HardcoreSK modpack + another 98 mods profiler set his patches for all mods and all harmony instances(exclude transpiled methods) in ~2 minutes. 5000 patches.
With transpiled methods ~30 minutes, how the game runs on my PC.

My tps on savegame without profiler patches ~200, with 5000 profiler patches for all mods ~60-100

Download
Github

Features

  • Profile harmony patches
    1. Get all active harmony instances
    2. Edit list for interested instances
    3. And set profiler for all patches in this instances

  • Profile mods
    1. Get all active mods(or manually input mod folder names)
    2. Edit list for interested mods
    3. And set profiler for all selected mods
    Profiler affects all HugsLib ticks in mods(if implemented) and custom(not Rimworld Core) workClasses in Defs directory for: ThingDef, Jobs, Interactions, Incidents, Recipes and etc...

  • Profile custom methods, classes or namespaces
    methods: Verse.Pawn:Tick
    methods in class: Verse.Pawn
    methods in all classes from namespace: Verse (dont do this for big namespaces like this  ;D)

  • Top 15
    -Review profiler results
    -'Copy' button add selected method in to custom list profiler
    -Click button with method name for hide entry from Top 15 results
    -You can export all collected data in to csv or slk for better review and filtering results in Excel. Slk format contain auto calculated columns width
    column AverageTime = 1 tick avg time
    column AvgTime*Ticks ~= time spent by the method for all time

Work window can be accessed from developer mode:


Profiler window:


Results in Excel(all timings in ms):


Credits
HugsLib for debug button

License
Mod and source code or his parts feel free to use. Credit is optional.

garfu


mospidatru

#2
Quote from: garfu on March 17, 2020, 05:30:56 PM
Any plans to update for 1.1?
Yes, it will be soon.

New for RW1.0:
1) Added full assembly profiling by dllname
2) Added feature for harmony patches dumper. Dump possible harmony patches conflicts, where Prefix patch can disable another prefixes or transpilers
3) some fixes

Kiame

Wow i am very interested in profiling all my mods. I am watching this for 1.1!


Kiame

Awesome I'll test it out tonight. Just curious do mod need to implent/use hugslib or does this mod support all mods? My mods do use Harmony but I do not use hugslib

mospidatru

Ye, support all mods. HugsLib not needed, but profiler if find in mod implemented hugslib tick he set profiler for him too.

Kiame


Kirmz


Kiame

Thank you again for this great mod! It's helped me find slow spots in some of my mods - especially change dresser - and find other mods that cause intermitant slow downs. Amazingly helpful!

mospidatru

Quote from: Kiame on April 06, 2020, 09:28:56 PM
Thank you again for this great mod! It's helped me find slow spots in some of my mods - especially change dresser - and find other mods that cause intermitant slow downs. Amazingly helpful!
Thanks for feedback. I'm glad the mod was useful  :)

hilllcheald

oh wow. thanks a lot for all the extremely informative and helpful information and links, i need for my healthy recipes project. that was just way too much. appreciating your effort.