django-debug-toolbar-template-profiler icon indicating copy to clipboard operation
django-debug-toolbar-template-profiler copied to clipboard

[experimental] Profile methods of view class

Open PetrDlouhy opened this issue 3 years ago • 1 comments

This is experimental and unfinished code, which adds profiling of all methods of view class. The PR contains commits from #17, but I can also rebase them out. This functionality is much simpler than the whole changelog - only the last commit.

I wanted to know more about my views timing, so I also runtimes of the view functions: Snímek z 2021-01-16 16-28-18

It is not perfect yet - for example the view has to be executed twice in order to patch the class correctly. I am not sure how to solve this, but I also didn't give it much time yet. Also it probably doesn't work for function base views, but I don't think it would be such problem to fix it.

I know, that this might be out of scope of this DJDT panel, but I would also don't want copy the code out of this package, because most of the code is shared. I also didn't find other DJDT panel with this functionality - the profiling panels I found were hard to set-up and did produce very complicated and unclear output.

So what do you think? Should this be made into this panel (which would then be view-profiler rather than template-profiler)?

PetrDlouhy avatar Jan 16 '21 15:01 PetrDlouhy