-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some additional docs would be needed #1
Comments
Doesn't look like it digs deep enough to identify issues with specific mods, but it should be possible to add that. For most things I use the official Unity profiler, but it does skew timing since it's running everything as debug (and sending the data to the profiler itself takes several milliseconds). The advantage of this project is that it can run on the release build and is very lightweight. Adding more capture zones might start to increase the overhead, I'm not sure. |
What this currently provide is a general game loop profiler with details on every major step, the tooltips should explain reasonably well what every line is about. The results include everything that is running, including code from plugins. This can mostly be useful for quick comparisons between general setups or situations, but doesn't help much in identifying specific bottlenecks. As Jonny mentioned, the main advantage (beside the fact that you can run this in-game) is that it can be run in a non-debug environment, and consequently will give more accurate results than the Unity profiler. The initial goal when I made this was to provide another profiling mode, where one could select specific methods to be profiled in the UI, by autogenerating a Harmony prefix and postfix, and computing per call and per frame stats for them. The core thing isn't too complicated to implement, but making that somewhat user friendly to use would be a bit more work. |
Harmony prefix and postfix patches can be added and removed dynamically right? It would also be amazing to get a list of the functions called in the method so that you could select one to dig into... |
Yeah, the idea was to be able to dynamically add or remove methods to be prefixed/postfixed, providing some sort of search UI based on reflection on types and members to do so. Ideally coupled with some config based system to save/load a set of methods to profile, as I would expect the typical use case to be "profile set of methods > make changes > restart KSP > profile again". Harmony patches can be removed dynamically, with the caveat that the original method will keep jumping through the dynamic method stub harmony created, which implies some tiny performance overhead for callers. This is fine for profiling a few selected methods, but will start to significantly skew overall results if used massively, so this doesn't really allow to make something that would for example deep profile whole call stacks. Plus Harmony patching has limitations, like no real support for generic classes/methods, and caveats related inlining, so trying to patch/profile arbitrary call stacks automatically would likely cause issues. |
This looks great, I tried it out.
I'm just a bit puzzled as to what it is providing. Is it only the Unity stuff, or would it show any misbehaving mods as well?
Also, (I'm greedy), could you get it added to CKAN?
The text was updated successfully, but these errors were encountered: