Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
pypy - o interpretador mais rapido do velho oeste
Andrews Medina
October 05, 2013
Technology
0
290
pypy - o interpretador mais rapido do velho oeste
Palestra sobre pypy apresentada na pythonbrasil[9].
Andrews Medina
October 05, 2013
Tweet
Share
More Decks by Andrews Medina
See All by Andrews Medina
Organizando dados juŕidicos em grafos
andrewsmedina
0
47
Clean Code - princípios e práticas para um código sustentável
andrewsmedina
0
420
Pytfalls
andrewsmedina
1
160
tsuru para quem sabe tsuru
andrewsmedina
0
57
globo.com s2 python
andrewsmedina
5
340
tsuru and docker
andrewsmedina
6
3.2k
fazendo deploys de forma simples e divertida com tsuru
andrewsmedina
3
110
let's go
andrewsmedina
2
290
TDD for Dummies
andrewsmedina
3
360
Other Decks in Technology
See All in Technology
Rコードのベンチマーク
bob3bob3
0
310
[Devfest] Optimize your Apps for Android (Go edition)
niharika28
1
270
【Unity】リリース時にデバッグ用リソースをちゃんと消す方法
harumak
0
280
Event-driven architecture
massa142
3
1.9k
OLM R&D祭2022 デジタル作画のパイプライン構築 -OLM FM Tool-
olmdrd
PRO
0
150
Understanding Cognitive Biases in Performance Measurement
bluesmoon
0
100
PLATEAU LT: PLATEAUデータをより使いやすくする スケールアップの方法
fullfull
0
680
エンプラ情シスのAWSあるある(業務システム編)
minorun365
9
5.6k
機械学習で無音サックスを作ろうとしたら音響特性とレイテンシに明るくなった話
nayopu
1
220
最近obnizを使った話(MESHやSpresenseとの組み合わせ) / IoTLT vol.92
you
0
180
Flaming Hot SLSA!
abhaybhargav
1
140
とりあえず抑えておきたい Railsでの「テストの内容」の考えかた #kaigionrails /Test code concepts to keep in mind for now with Rails
shinkufencer
3
500
Featured
See All Featured
Agile that works and the tools we love
rasmusluckow
319
19k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
15
1.1k
A Philosophy of Restraint
colly
193
15k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
317
19k
Writing Fast Ruby
sferik
613
57k
Debugging Ruby Performance
tmm1
66
11k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
214
20k
Rails Girls Zürich Keynote
gr2m
87
12k
Mobile First: as difficult as doing things right
swwweet
213
7.6k
Optimizing for Happiness
mojombo
364
64k
The Mythical Team-Month
searls
210
40k
Art Directing for the Web. Five minutes with CSS Template Areas
malarkey
196
9.7k
Transcript
globo .com pypy o interpretador mais rápido do velho oeste
Saturday, October 5, 13
Saturday, October 5, 13
‣ djangobrasil ‣ globo.com desde 2008 ‣ splinter ‣ tsuru
@andrewsmedina Saturday, October 5, 13
‣ sabe o que é? ‣ sabe o que é
rpython? ‣ já usou pypy? ‣ já usou rpython? pypy? Saturday, October 5, 13
‣ rpython ‣ pypy ‣ mitos ‣ como contribuir cronograma
Saturday, October 5, 13
rpython Saturday, October 5, 13
‣ quem já teve vontade de escrever um compilador/ interpretador?
‣ que já implementou um? ? Saturday, October 5, 13
‣ python subset ‣ traduz rpython para c ‣ ferramenta
para escrever interpretadores rpython Saturday, October 5, 13
‣ sintaxe x implementação x backend ‣ js x jit
x c ‣ ruby x gc mark sweep x c ‣ ruby x jit x jvm rpython Saturday, October 5, 13
‣ pypy ‣ topaz ‣ lang-js ‣ lang-scheme ‣ lang-smaltalk
‣ pygirl (gameboy) ‣ lang-io ‣ hippy interpretadores Saturday, October 5, 13
pypy Saturday, October 5, 13
‣ performance ‣ eficiência ‣ compatibilidade com cPython pypy Saturday,
October 5, 13
performance Saturday, October 5, 13
‣ python 2.7.3 ‣ algumas coisas em rpython compatibilidade Saturday,
October 5, 13
‣ efeito colateral por escrever python em python interpretador level
vs app level Saturday, October 5, 13
app level Saturday, October 5, 13
interpretador level Saturday, October 5, 13
compatibilidade Saturday, October 5, 13
‣ navite code > bytecode ‣ compilação do bytecode ‣
“esquentar o interpretador” jit Saturday, October 5, 13
def f2(x, y): x = hint(x, promote=True) z = x
* 2 + 1 return z + y jit Saturday, October 5, 13
guard(x == 4) v1 = x * 2 z =
v1 + 1 v2 = z + y return(v2) jit Saturday, October 5, 13
guard(x == 4) v2 = 9 + y return(v2) jit
Saturday, October 5, 13
‣ cPython: reference counting ‣ pypy: minimark garbage collector Saturday,
October 5, 13
class B(object): def __del__(self): print "oie" garbage collector Saturday, October
5, 13
>>>> b = B() >>>> b = 1 >>>> garbage
collector - pypy Saturday, October 5, 13
>>> b = B() >>> b = 1 oie garbage
collector - cPython Saturday, October 5, 13
b = B() a = B() b.x = a a.x
= b garbage collector Saturday, October 5, 13
‣ executar c no python ‣ pip install cffi cffi
Saturday, October 5, 13
cffi Saturday, October 5, 13
‣ concorrencia ‣ inspirado pelo http://www.stackless.com/ ‣ http://greenlet.readthedocs.org/en/latest/ stackless Saturday,
October 5, 13
‣ paralelismo ‣ baseado em banco de dados stm Saturday,
October 5, 13
‣ escrito em rpython ‣ já funciona :) ‣ http://buildbot.pypy.org/numpy-status/latest.html
numpy + pypy Saturday, October 5, 13
>>>> import numpypy >>>> numpypy.array([1,2,3]) array([1, 2, 3]) >>>> numpy
+ pypy Saturday, October 5, 13
numpy + pypy ‣ 231/559 names ‣ 131/161 ndarray attributes
‣ 34/48 dtype attributes ‣ 63/134 generic attributes ‣ 28/32 flatiter attribute Saturday, October 5, 13
mitos Saturday, October 5, 13
integração com c Saturday, October 5, 13
‣ funciona com ctypes (mysqldb) ‣ cffi integração com c
Saturday, October 5, 13
‣ funciona com ctypes (mysqldb) ‣ cffi integração com c
Saturday, October 5, 13
python3 Saturday, October 5, 13
python3 Saturday, October 5, 13
python3 Saturday, October 5, 13
6x mais rápido que cPython Saturday, October 5, 13
6x mais rápido que cPython Saturday, October 5, 13
6x mais rápido que cPython Saturday, October 5, 13
6x mais rápido que cPython Saturday, October 5, 13
compilar pypy demora Saturday, October 5, 13
compilar pypy demora Saturday, October 5, 13
compilar pypy demora Saturday, October 5, 13
compilar pypy demora Saturday, October 5, 13
compilar pypy demora Saturday, October 5, 13
‣ pypy.org ‣ virtualenv ‣ testes ‣ benchmarks como começar
Saturday, October 5, 13
‣ bugs.pypy.org ‣ https://bitbucket.org/pypy/pypy ‣ http://doc.pypy.org ‣ doações (stm, numpy,
python3) como contribuir Saturday, October 5, 13
obrigado! @andrewsmedina Saturday, October 5, 13