Live data from Hacker News

Visual profiler for Python

github.com

1–10 of 38 posts

Re: Visual profiler for Python

#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.

Re: Visual profiler for Python

#8
post #5
post #4

How do I use this visual profiler to profile a Flask app?

You'd just run the flask app under the profiler and send requests as you normally would, right? Am I missing something?

I haven't profiled any webapps yet, but you can profile functions inside your Flask app.

First you start profiler in remote mode

    vprof -r 
and then use vprof.profiler.run function:

    profiler.run(foo, 'cmh', args=(arg1, arg2), host='localhost', port=8000)
(replace host and port if you run your webappp on another maching with address of machine you run "vprof -r" on).

This will run profiler and send stats to server in JSON format.

Re: Visual profiler for Python

#9
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.

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

Re: Visual profiler for Python

#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

Post reply on HN