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 at the Speed of Light (ok, not really)
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Chad Estioco
February 23, 2014
Programming
0
230
Python at the Speed of Light (ok, not really)
Talk done for Chikka at PyCon PH 2014.
Chad Estioco
February 23, 2014
Tweet
Share
More Decks by Chad Estioco
See All by Chad Estioco
Don't Panic
skytreader
0
32
The Use of Useless Things
skytreader
0
450
TDD with Python
skytreader
1
220
Heads of the Hydra
skytreader
0
180
Other Decks in Programming
See All in Programming
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
180
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.4k
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
220
CSC307 Lecture 04
javiergs
PRO
0
660
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
AI & Enginnering
codelynx
0
110
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
430
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
170
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
690
Fluid Templating in TYPO3 14
s2b
0
130
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
1k
AtCoder Conference 2025
shindannin
0
1.1k
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
96
14k
Paper Plane
katiecoart
PRO
0
46k
The Spectacular Lies of Maps
axbom
PRO
1
520
Prompt Engineering for Job Search
mfonobong
0
160
Color Theory Basics | Prateek | Gurzu
gurzu
0
200
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
130
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
Everyday Curiosity
cassininazir
0
130
Designing Powerful Visuals for Engaging Learning
tmiket
0
240
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
Transcript
Python in the Speed of Light (ok, not really)
Chad n. chocolate-consuming, code-churning, curious creature currently coding for Chikka’s
Connectiviteam (sic) who? me?
the sad truth: python is s.l.o.w.
the sad truth: python is s.l.o.w. http://benchmarksgame.alioth.debian.org/u64q/benchmark.php? test=all&lang=python3&data=u64q
so how come we can live with it? Source: http://www.python.org/about/quotes/
alas! all is not yet lost! (yay!)
we can optimize stuff (lots of it!)
we can optimize algorithms
[optimize algorithms] Big-“Oh” notation: O(f(n)) naive, what you probably learned
in CS undergrad
we can optimize architecture
[optimize architecture]
we can optimize actual runtime
[optimize runtime] JIT in a nutshell: good? bad?
[optimize runtime] PyPy Stackless
we can optimize hardware
[optimize hardware] do not confuse with CPython!
[optimize hardware] PyCUDA!
[optimize hardware] more in a short while after this mini
public service announcement...
we can also micro-optimize (oh… :[ )
[micro-optimization] if most probable condition: do_stuff() elif next most probable
condition: do_stuff() elif third most probable condition: do_stuff() . . . . . . . . . else: # least probable condition do_stuff() ever heard of this pattern? →
[back to regular programming*] let’s talk a bit about gevent
*pun intended
gevent is… 53.7% Python 35.8% C 10.3% Shell 0.1% Other
See: https://github.com/surfly/gevent
gevent is… 53.7% Python 35.8% C 10.3% Shell 0.1% Other
See: https://github.com/surfly/gevent ← see here, C here?
gevent a closer look installing from github … pip install
cython git+git://github.com/surfly/gevent. git#egg=gevent See: https://github.com/surfly/gevent#installing-from-github
cython: what? when? how?
what cython? Python → machine code
when cython? let C handle the bottleneck
how cython? ...and now, source code
speed of C + syntax of Python? cython everything!
pycuda: numbers/matrices/math anyone?
what about graphics?
cuda comes from nvidia
gpu parallelism + syntax of Python? pycuda everything!
take optimization and benchmarking with grains of salt. lots of
it. experimental set-ups vary greatly from real-world environments.