We will be learning techniques on how to optimize our python coding.
Pat Miller is a long time Python programmer. He's been happily hacking away with the language for almost 18 years. His background and Ph.D. are in the study of parallelism and computer languages. He worked at Lawrence Livermore Labs for almost 20 years working on everything from compilers to nuclear weapons. He was also a consulting professor at Stanford. He moved to NYC to work at DE Shaw Research on specialized supercomputers for molecular dynamics before heading over to work in finance at JP Morgan, and, most recently, Jump Trading. As a local Python Guru, Pat concentrates on running Python efficiently in a high performance environment.
Python is often though of as "fast enough." Not as fast as C++or Java, but fast enough to work in a lot of environments. Sometimes, though, we want it to be a little faster. We could put in a lot of effort and make it 100x faster, but we would rather put in a little effort and make it 10-20% faster. This talk explores one, simple, generally useful optimization technique for improving Python's runtime performance. We'll look at the byte codes that lurk underneath every Python function. We'll get a quick understanding of how Python functions execute. Finally, we'll show how to rewrite the byte codes with peephole optimizers to remove the most glaring inefficiencies. The technique can remove 10-30% of useless overhead in a lot of typical Python functions. There's a short demo following the talk. The code is all downloadable via github.