Re:Hunting Performance in Python Code: Measuring Memory Cons...
by dom0 on Thursday June 01, 2017 @04:35PM
(#14464363)
On Windows, VTune supports managed code sampling (Java, Python, ...); it basically decodes the internal state of the VM (such as PyEval_FrameEx). The basics work on Linux as well, but as usual setup is more painful due to kernel issues. The most basic analyses do not require kernel support.
It's one of these "Developers, Developers, Developers, Developers, Developers, Developers, Developers" Tools...
-
PyCharm has a Concurrency Visualizer, which sounds nice, but it does only apply to Python locks, excluding the GIL. Oops...
Re:Hunting Performance in Python Code: Measuring Memory Cons...
by bobosha on Thursday June 01, 2017 @01:48PM
(#14462614)
> mention that the visual studio IDE's Python support has a _mean_ profiler. hotpath/comparative reports/drill down/pretty pictures.
Is that VS code python? or the full visual studio?
Re:Hunting Performance in Python Code: Measuring Memory Cons...
by existencebox on Thursday June 01, 2017 @01:52PM
(#14462647)
Full. Code does debugging, but no profiling yet. (I have no knowledge as to that particular roadmap, but I can hope)
I'd also, with the _Massive_ disclaimer that I'm a MSFTie working for the Python group, mention that the visual studio IDE's Python support has a _mean_ profiler. hotpath/comparative reports/drill down/pretty pictures.
That all being said I'd be curious if anyone else would echo my sentiment that maybe 85% of the python perf issues I've seen in practice (in both my own code and others, and even in light of the more sophisticated "best practices" I often read) come down to one of:
- linear datastructures/algos instead of dicts/sets
- deeply nested loops
- excessive conversion between "stuff" (which basically falls back to #2) and/or lack of memoization.
Tooling aside, it gives me a nice dose of mental conflict re: utility of algo knowlege in interviews, as someone who typically rails against it...