Live data from Hacker News

Visual profiler for Python

github.com

11–20 of 38 posts

Re: Visual profiler for Python

#13
KCacheGrind relies on using valgrind, which gives you extremely detailed information on runtime information by wrapping your execution context at a very low level. For this reason, it can track individual memory allocations, function call statistics, etc. However, for Python, that can be a bit overkill; usually you're just looking to measure what parts of your code are taking up executing time and heap space.

This package uses cProfile, psutils, and pstats go get runtime information on your code as it's running. It's doing what valgrind does but in a much "higher-level" fashion, in pure Python. This means that it can give you more relevant information about your Python code.

Re: Visual profiler for Python

#14
post #10

You can also just use Python for Visual Studio[0] if you're on Windows. [0] https://www.visualstudio.com/en-us/features/python-vs.aspx

Here's a YT video that shows off the profiler in PTVS (warning - loud cowbells) edit: forgot link - https://www.youtube.com/watch?v=K-KqkFkp55k

I think you forgot the video!

Re: Visual profiler for Python

#15
post #7

You can also just use Python for Visual Studio[0] if you're on Windows. [0] https://www.visualstudio.com/en-us/features/python-vs.aspx

Is it just me, or running programs under PTVS slows them down by quite a bit? Even when I turn off debugging, it still seems to be slower than when I run the program from the terminal.

Can you clarify what you mean by "turn off debugging"? Are you doing Project | Start without Debugging?

Re: Visual profiler for Python

#16

I like the flame graphs. Reminded me about the Netflix JavaScript Talks - Debugging Node.js in Production[0] talk, 11 min in. [0]: https://www.youtube.com/watch?v=O1YP8QP9gLA

Just as an FYI, youtube links support a time bookmark at the end of the URL with `?v=CAFEBABE#t=11m0s` (in your example); the "share" widget on the site will encode the bookmark for you, if you prefer that method.

Re: Visual profiler for Python

#17
Looks like an awesome piece of technology, but why, whenever I see headline xxxx followed by "(github.com)" do I get a slight feeling of despair - that feeling that this project has a high chance of being future abandonware. Is it that having a proper, dedicated, expensive-looking, website, away from github, is a signal of access to resources, willingness to do proper marketing and documentation, and therefore, by correlation, longevity?

Re: Visual profiler for Python

#19
post #9
post #7

Earlier quoted context omitted.

Is it just me, or running programs under PTVS slows them down by quite a bit? Even when I turn off debugging, it still seems to be slower than when I run the program from the terminal.

It is slower for me as well, but the debugger is excellent.

perhaps hitting F5 instead of ctrl-F5 (run w/o debugging)?

Re: Visual profiler for Python

#20

I like the flame graphs. Reminded me about the Netflix JavaScript Talks - Debugging Node.js in Production[0] talk, 11 min in. [0]: https://www.youtube.com/watch?v=O1YP8QP9gLA

As a Python learner, very excited to try this out on my code. I'm aware of other tools that can generate these visualizations but figuring out how to use them has seemed like a daunting task for someone like myself who barely understands what bytecode is; hoping this tool will serve as an accessible learning tool!
Post reply on HN