$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Python at the Speed of Light (ok, not really)
Search
Chad Estioco
February 23, 2014
Programming
0
220
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
31
The Use of Useless Things
skytreader
0
430
TDD with Python
skytreader
1
210
Heads of the Hydra
skytreader
0
170
Other Decks in Programming
See All in Programming
sbt 2
xuwei_k
0
260
안드로이드 9년차 개발자, 프론트엔드 주니어로 커리어 리셋하기
maryang
1
110
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
200
AtCoder Conference 2025「LLM時代のAHC」
imjk
1
290
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
150
Microservices Platforms: When Team Topologies Meets Microservices Patterns
cer
PRO
1
1k
WebRTC と Rust と8K 60fps
tnoho
2
1.9k
AIコーディングエージェント(Manus)
kondai24
0
160
SwiftUIで本格音ゲー実装してみた
hypebeans
0
110
開発に寄りそう自動テストの実現
goyoki
1
770
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
310
【CA.ai #3】Google ADKを活用したAI Agent開発と運用知見
harappa80
0
300
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Fireside Chat
paigeccino
41
3.7k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
How GitHub (no longer) Works
holman
316
140k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
70k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Speed Design
sergeychernyshev
33
1.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.8k
The World Runs on Bad Software
bkeepers
PRO
72
12k
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.