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
pypy - o interpretador mais rapido do velho oeste
Search
Andrews Medina
October 05, 2013
Technology
0
360
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
90
Clean Code - princípios e práticas para um código sustentável
andrewsmedina
0
560
Pytfalls
andrewsmedina
1
180
tsuru para quem sabe tsuru
andrewsmedina
0
71
globo.com s2 python
andrewsmedina
5
370
tsuru and docker
andrewsmedina
6
3.5k
fazendo deploys de forma simples e divertida com tsuru
andrewsmedina
3
140
let's go
andrewsmedina
2
300
TDD for Dummies
andrewsmedina
3
370
Other Decks in Technology
See All in Technology
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
150
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
120
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
32k
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
KubeCon NA 2024 Recap: How to Move from Ingress to Gateway API with Minimal Hassle
ysakotch
0
200
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
TSKaigi 2024 の登壇から広がったコミュニティ活動について
tsukuha
0
160
Postman と API セキュリティ / Postman and API Security
yokawasa
0
200
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
150
なぜCodeceptJSを選んだか
goataka
0
160
Storage Browser for Amazon S3
miu_crescent
1
140
AWS re:Invent 2024 ふりかえり
kongmingstrap
0
130
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
How to Ace a Technical Interview
jacobian
276
23k
A Modern Web Designer's Workflow
chriscoyier
693
190k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Visualization
eitanlees
146
15k
The Cult of Friendly URLs
andyhume
78
6.1k
For a Future-Friendly Web
brad_frost
175
9.4k
Become a Pro
speakerdeck
PRO
26
5k
A better future with KSS
kneath
238
17k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
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