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

Python at the Speed of Light (ok, not really)

Chad Estioco
February 23, 2014

Python at the Speed of Light (ok, not really)

Talk done for Chikka at PyCon PH 2014.

Chad Estioco

February 23, 2014
Tweet

More Decks by Chad Estioco

Other Decks in Programming

Transcript

  1. [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? →
  2. gevent is… 53.7% Python 35.8% C 10.3% Shell 0.1% Other

    See: https://github.com/surfly/gevent
  3. gevent is… 53.7% Python 35.8% C 10.3% Shell 0.1% Other

    See: https://github.com/surfly/gevent ← see here, C here?
  4. 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
  5. take optimization and benchmarking with grains of salt. lots of

    it. experimental set-ups vary greatly from real-world environments.