Live data from Hacker News

Show HN: Silk, a profiling tool for Django

mtford.co.uk

1–10 of 25 posts

Re: Show HN: Silk, a profiling tool for Django

#2
Very cool, this seems much nicer than using hotshot to profile Django.

I'm a little confused by this page though: http://mtford.co.uk/silk/request/1907/profiling/. Why is wrapped_target listed so many times for a single blog post query? Is there a hierarchy to the profile calls that's not shown? Oh, does it go deepest level to highest level calls?

Re: Show HN: Silk, a profiling tool for Django

#4
post #2

Very cool, this seems much nicer than using hotshot to profile Django. I'm a little confused by this page though: http://mtford.co.uk/silk/request/1907/profiling/ . Why is wrapped_target listed so many times for a single blog post query? Is there a hierarchy to the profile calls that's not shown? Oh, does it go deepest level to highest level calls?

Thats a great question... that def shouldn't be there. render_to_response is actually dynamically profiled i.e. the decorator is applied at runtime via configuration in settings.py. This looks like its probably a bug with that. Cheers, will look into it

Re: Show HN: Silk, a profiling tool for Django

#5

After reading through this intro, it isn't clear to me if I can use the decorator or context manager to profile code outside the request/response cycle. Any ideas if that's the case?

Not at the moment. Silk doesn't actually save anything down until right at the end of the cycle i.e. in process_response of the middleware. Had to do this to avoid issues with atomic transactions. I certainly don't mind adding this as a feature if people would find that useful - perhaps by detecting that no request is in process and then commiting profile data on the fly if that's the case.

Re: Show HN: Silk, a profiling tool for Django

#7
Looks very interesting! We currently use django debug toolbar for profiling, which seems to have a lot of overlap. I like how Silk stores the profiles of multiple requests - that seems to be a nice differentiator. What else? Thanks for the awesome contribution to the Django community!

Re: Show HN: Silk, a profiling tool for Django

#8

Looks very interesting! We currently use django debug toolbar for profiling, which seems to have a lot of overlap. I like how Silk stores the profiles of multiple requests - that seems to be a nice differentiator. What else? Thanks for the awesome contribution to the Django community!

Yep django-toolbar is great! My aim with this was, like you said, to provide the history of multiple requests, but also to provide finer-grained profiling with the decorator and context manager. Not only do they capture execution time but they also capture the queries that were executed whilst they were active. The aim was extra visibility all round really.
Post reply on HN