-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Profiling Tab 0.1 #156
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
Profiling Tab 0.1 #156
Conversation
settings.PROJECT_ROOT is not defined in all scopes, you should be able to pull in the root urlconf or something similar to potentially default this setting (I'm merging this into my branch right now to ensure some compatibility) |
Also, tons of lint violations :) |
And there's a loose print statement |
I'm going to overhaul some of the UX on this on my fork as well to bring it up to date with some changes I was doing to the SQL panel, possibly add in timeline support, and just other general enhancements. Like the concept so far though :) |
There's also an issue on first load that profile doesnt load correctly |
Thanks dcramer, would love to see what somebody with some decent UX chops could do. What tool are you using to lint? I'm a fairly recent convert to python/django from java and am still trying to figure out the best way to do things. In retrospect there was probably a lot of cleanup I should have done before pushing this into the world. |
Linting: I use SublimeLint for Sublime Text 2, and a bundle I wrote for TextMate: http://justcramer.com/2010/11/30/integrating-pyflakes-into-textmate/ |
Something else I want to note, we might be able to integrate line_profiler (which is a fair bit nicer for this kind of profiling) as an alternative Here's an example in django-devserver: dcramer/django-devserver#29 |
I've actually got a local only branch that combines line_profiler output with the cProfiler output. The issues on that pull requests are essentially identical to this one. Figuring out what function/functions to profile needs to be done before they're run since they need to be explicitly set. In the process_view function there's a pointer to the view function, but if the user is using any decorators, you end up profiling the decoration. I've got a terribly hacky method of recursively unrolling decoration closures, but that doesn't solve the problem of any subfunctions that ought to be profiled. |
If anybody wants to take a look at the code that integrates line_profiler it's at https://github.com/dmclain/django-debug-toolbar/tree/line_profiler_int |
This is now merged in (though GitHub doesnt seem to think so) |
I've been using some custom middleware for a while to get some rough profiling information and wanted to get something into the debug toolbar for convenience. Last night I finally got around to it, and this is the result.
The good
The Bad
The Ugly