Upgrade to Pro — share decks privately, control downloads, hide ads and more …

pypy - o interpretador mais rapido do velho oeste

pypy - o interpretador mais rapido do velho oeste

Palestra sobre pypy apresentada na pythonbrasil[9].

Andrews Medina

October 05, 2013
Tweet

More Decks by Andrews Medina

Other Decks in Technology

Transcript

  1. ‣ sabe o que é? ‣ sabe o que é

    rpython? ‣ já usou pypy? ‣ já usou rpython? pypy? Saturday, October 5, 13
  2. ‣ quem já teve vontade de escrever um compilador/ interpretador?

    ‣ que já implementou um? ? Saturday, October 5, 13
  3. ‣ python subset ‣ traduz rpython para c ‣ ferramenta

    para escrever interpretadores rpython Saturday, October 5, 13
  4. ‣ 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
  5. ‣ pypy ‣ topaz ‣ lang-js ‣ lang-scheme ‣ lang-smaltalk

    ‣ pygirl (gameboy) ‣ lang-io ‣ hippy interpretadores Saturday, October 5, 13
  6. ‣ navite code > bytecode ‣ compilação do bytecode ‣

    “esquentar o interpretador” jit Saturday, October 5, 13
  7. def f2(x, y): x = hint(x, promote=True) z = x

    * 2 + 1 return z + y jit Saturday, October 5, 13
  8. guard(x == 4) v1 = x * 2 z =

    v1 + 1 v2 = z + y return(v2) jit Saturday, October 5, 13
  9. guard(x == 4) v2 = 9 + y return(v2) jit

    Saturday, October 5, 13
  10. >>>> b = B() >>>> b = 1 >>>> garbage

    collector - pypy Saturday, October 5, 13
  11. >>> b = B() >>> b = 1 oie garbage

    collector - cPython Saturday, October 5, 13
  12. b = B() a = B() b.x = a a.x

    = b garbage collector Saturday, October 5, 13
  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