#4056 closed enhancement (fixed)
[PATCH] Improve Profiler2
Reported by: | wraitii | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 21 |
Component: | Core engine | Keywords: | patch |
Cc: | Patch: |
Description
We currently have 2 in-game profilers. Profiler1 can be seen from in-game and gives you average results, which is rather useful to know if something is generally too slow. Profiler2 returns events as an absolute amount of time, and the http server is very useful if you want to see spikes, but rather rubbish otherwise. The problem is that right now we profile too many things and the buffer gets overwritten very quickly, which leads to a rather limited usefulness. The presentation of things is also not the best.
It would be good to improve Profiler2 to have more functionality and provide better analysis, such as full game profiling.
Attachments (4)
Change History (13)
by , 8 years ago
Attachment: | Profiler2.patch added |
---|
by , 8 years ago
Attachment: | profiler-fixheader.patch added |
---|
Fix mistaken header in script.interface: should be SVN compatible
comment:1 by , 8 years ago
Keywords: | patch review added |
---|
Please review only the fixheader patch. It should compile. If it does, it should be committed as the header is useless in ScriptInterface.h and makes compile time on changes in the profiler really big (it still is after the patch, mind you).
The other 2 patches improve the functionality of Profiler2. Changes, Cpp side: -duration of profiling is stored relative to the last sync marker instead of the last event. This seems to fix weirdness in the output and should probably be done anyhow -Add a new struct type that only writes in the main buffer if the time taken is above a certain threshold. In the meantime, it writes to a temp buffer. There are 8 levels of buffer, so you can nest 8 of them (warning: this can happen easily if things become recursive). Can crash though, needs a bit more work.
The usefulness of this last struct is that you may want to profile "spikes" in some functions but not clutter the buffer (as it's only 1MB right now). So with that function, you can.
Generally speaking I think the profiler threads should have more state, such as a region that compiles events that are named similarly, perhaps? It can be useful. Also add a few mostly useless things
JS side: -fixed a bug (precision was too low, errored out and showed nothing) -the frame canvas on top is rendered on a logarithmic scale. -Added a canvas but it's mostly broken tbh. -Added a button to save current buffer JSON to a file, which you can then read offline. -Changed the zoom handlers so the zoom is more usable -WIP function to output some stats but maybe Profiler1 should do that.
My JS changes are mostly useless (except the scale things and the bug)
comment:2 by , 8 years ago
Update version allows showing 2 useful graphs and compare replays. Still WIP.
comment:6 by , 8 years ago
Keywords: | performance removed |
---|---|
Summary: | Improve Profiler2 → [PATCH] Improve Profiler2 |
Got a compile warn http://pastebin.com/q3mDmJdD, is it that http://pastebin.com/RzTzentF ? review keyword can go I suppose?
comment:8 by , 8 years ago
Keywords: | review removed |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Profiler2 core changes.