News for hackers. Stuff that matters.
Re:Visual profiler for Python by romanovcode on Thursday May 19, 2016 @02:11PM (#11732295)
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

Re:Visual profiler for Python by smortaz on Thursday May 19, 2016 @02:40PM (#11732559)
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

Re:Visual profiler for Python by JBReefer on Thursday May 19, 2016 @03:35PM (#11733074)
I think you forgot the video!
Re:Visual profiler for Python by smortaz on Thursday May 19, 2016 @04:25PM (#11733495)
oops, thx, fixed.
Re:Visual profiler for Python by dancsi on Thursday May 19, 2016 @02:34PM (#11732502)
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 by int_19h on Thursday May 19, 2016 @03:47PM (#11733163)
Can you clarify what you mean by "turn off debugging"? Are you doing Project | Start without Debugging?
Re:Visual profiler for Python by chuckkir on Thursday May 19, 2016 @02:39PM (#11732553)
It is slower for me as well, but the debugger is excellent.
Re:Visual profiler for Python by smortaz on Thursday May 19, 2016 @04:26PM (#11733507)
perhaps hitting F5 instead of ctrl-F5 (run w/o debugging)?
Re:Visual profiler for Python by fijal on Thursday May 19, 2016 @05:30PM (#11734042)
TL;DR; it's a visualizer for cProfile (with all the cProfile problems)

DISCLAIMER: I'm an author of cProfile competitor, vmprof

Re:Visual profiler for Python by fabioz on Thursday May 19, 2016 @02:57PM (#11732732)
http://www.pyvmmonitor.com also provides a nice visual profiler.
Re:Visual profiler for Python by infinite8s on Friday May 20, 2016 @01:17PM (#11739641)
I noticed that PyVMMonitor is built on PyQt. Mind if I ask you some questions about how you licensed the underlying tech stack to be able to sell it?
Re:Visual profiler for Python by grinich on Friday May 20, 2016 @02:42AM (#11735920)
We did something similar at Nylas, but we built it to run in production across our entire fleet: https://nylas.com/blog/performance/
Re:Visual profiler for Python by devy on Thursday May 19, 2016 @02:29PM (#11732459)
Intellij-based PyCharm uses yappi[1] or cProfile to provide similar visual profiling functionalities.

[1]: https://bitbucket.org/sumerc/yappi/

Re:Visual profiler for Python by oneweekwonder on Thursday May 19, 2016 @02:41PM (#11732569)
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

Re:Visual profiler for Python by mdaniel on Thursday May 19, 2016 @03:58PM (#11733265)
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 by ghostly_s on Thursday May 19, 2016 @04:38PM (#11733609)
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!
Re:Visual profiler for Python by oxplot on Saturday May 21, 2016 @07:48AM (#11744343)
I have just recently discovered chrome://tracing and wrote a quick python profiler [1] to output in its format.

[1]: https://github.com/oxplot/crprof

Re:Visual profiler for Python by devy on Thursday May 19, 2016 @02:23PM (#11732409)
How do I use this visual profiler to profile a Flask app?
Re:Visual profiler for Python by markbnj on Thursday May 19, 2016 @02:26PM (#11732438)
You'd just run the flask app under the profiler and send requests as you normally would, right? Am I missing something?
Re:Visual profiler for Python by nvdv on Thursday May 19, 2016 @02:36PM (#11732520)
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 by JonathonW on Thursday May 19, 2016 @09:33PM (#11735095)
Neat-- wish I'd had this a few weeks ago when I was trying to track down some performance issues.

(Ended up getting what I needed out of cProfile, which this also uses on the backend. Would've been nice to have the nice visualizations, though.)

Re:Visual profiler for Python by DiThi on Thursday May 19, 2016 @11:37PM (#11735415)
Is there a similar tool of the code heatmap but for JS?
Re:Visual profiler for Python by brndn on Thursday May 19, 2016 @11:41PM (#11735426)
Re:Visual profiler for Python by DiThi on Friday May 20, 2016 @04:12AM (#11736249)
I mean the code coverage tool, not the flame graphs. To e.g. know what paths of the code are never executed. Chrome and Firefox already show flame graphs in their profilers.
Re:Visual profiler for Python by roberdam on Friday May 20, 2016 @08:35AM (#11737249)
"RuntimeError: maximum recursion depth exceeded while calling a Python object "

When installing.

Re:Visual profiler for Python by fijal on Thursday May 19, 2016 @05:29PM (#11734034)
I would like to complain about name similarity to vmprof (my project)
Re:Visual profiler for Python by daveguy on Friday May 20, 2016 @12:44AM (#11735592)
You're kidding, right?
Re:Visual profiler for Python by kolapuriya on Thursday May 19, 2016 @03:05PM (#11732812)
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 by forgotpwtomain on Friday May 20, 2016 @12:28AM (#11735538)
> It's doing what valgrind does but in a much "higher-level" fashion, in pure Python.

Valgrind is essentially a VM, this uses cProfile - I wouldn't call that doing the 'same thing' at all.

Re:Visual profiler for Python by _yosefk on Thursday May 19, 2016 @04:41PM (#11733644)
Actually KCachegrind displays files in an open format and is great for visualizing profiling info obtained from other tools.
Re:Visual profiler for Python by vegabook on Thursday May 19, 2016 @04:14PM (#11733411)
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 by rhinoceraptor on Thursday May 19, 2016 @04:57PM (#11733772)
If it's going to be abandonware, isn't it better to be on Github where it's easily accessible, rather than a random git server that could disappear?
Re:Visual profiler for Python by notifier2050 on Thursday May 19, 2016 @05:38PM (#11734081)
Like with almost any open source project nobody promises you anything. But it's not framework, you don't lose much by not using it and you don't have to rewrite your code in case it would be abandoned.
Re:Visual profiler for Python by vegabook on Thursday May 19, 2016 @05:52PM (#11734167)
yes I realise that I'm looking a gift horse in the mouth, and I love git(hub), but I'm just pointing out that "(github.com)" might just be a net-negative marketing point for people looking for robust software.
Re:Visual profiler for Python by albasha on Thursday May 19, 2016 @07:15PM (#11734594)
Does it work with Django? If so, how?
Re:Visual profiler for Python by gsmethells on Thursday May 19, 2016 @02:09PM (#11732282)
Cool!