Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
MASTERING PYCHARM

You're reading from   MASTERING PYCHARM Use PyCharm with fluid efficiency to write idiomatic python code

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781783551316
Length 232 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Nafiul Islam Nafiul Islam
Author Profile Icon Nafiul Islam
Nafiul Islam
Arrow right icon
View More author details
Toc

Profiling


Profiling is a new addition to PyCharm 4.5, and has a nice set of features, most notably, a graphic representation of the calls made. We are going to use the previously mentioned downloader.py file to demonstrate some of the new features.

We simply right-click anywhere on the file and then left-click on Profile 'downloader'. With this, we will be taken to a new panel that shows us a call table.

We can also see that if we choose to, we can jump to both the source and the call graph. The call graph is a graphical representation of what functions are being called where and their impact; green means small impact and red means high impact. This is really quite useful since we can optimize slow code on the spot if the optimization is simple.

Furthermore, the call graph gives us a nice colorized hierarchical representation of function calls.

We can also export the graph files for others to see. If we right-click on any of the call blocks in the call graph, we can jump to the source.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime