Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Python Profiling 101
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Nazar Kanaev
September 22, 2020
Programming
0
120
Python Profiling 101
Nazar Kanaev
September 22, 2020
Tweet
Share
More Decks by Nazar Kanaev
See All by Nazar Kanaev
Core Data
nkanaev
0
100
Other Decks in Programming
See All in Programming
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
640
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
Oxlintはいいぞ
yug1224
5
1.3k
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
130
AtCoder Conference 2025
shindannin
0
1k
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
110
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
組織で育むオブザーバビリティ
ryota_hnk
0
170
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
550
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
AgentCoreとHuman in the Loop
har1101
5
230
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
180
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
54
8k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
410
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
エンジニアに許された特別な時間の終わり
watany
106
230k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
3.9k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
100
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
140
Designing Powerful Visuals for Engaging Learning
tmiket
0
230
So, you think you're a good person
axbom
PRO
2
1.9k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.2k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
53
Transcript
Python Profiling 101
None
What is Profiling
dynamic program analysis to measure usage / time / memory
of function calls / instructions / etc.
analyse the whole program / certain functions to find slowest
/ memory-consuming parts
None
How it works
Python API PyEval_SetTrace / PyEval_SetProfile sys.settrace / threading.settrace
OS-level API py-spy: process_vm_readv (linux) / vm_read (macos) / ReadProcessMemory
(windows) fil: malloc/calloc/alloc/free (linux & macos)
None
Choosing the right tool
deterministic vs. statistical/sampling pure-python vs. compiled call stack vs. line
granularity time vs. memory
built-in: profile/cProfile + pstats trace tracemalloc
3rd-party: vprof memory_profiler pprofile ...dozens of wrappers & custom solutions
None
Common advice
pure-python profilers add more overhead than the compiled ones choose
the latter if execution speed is more important
deterministic profiling is accurate, but slower than sampling profiling for
long-running tasks sampling profiling might be more preferred
None
The End