»PyPy - the hero we all deserve.«
2019-06-04, 10:30–10:55, Hall 3
As a full-stack developer in an Algo-trading / HFT world, I’m being asked very often: “Yeah but, python is too slow for that, nope?” During my talk, I will demonstrate how I deal with performance / high throughput problems using PyPy, including exam
Python is amazing. It gives us the ability the code various applications quickly, using a variety of packages. However, it is relatively slow compared to other programming languages performing the same tasks.
As a full-stack engineer in an Algo-trading HFT company, I often need to create super fast applications with very short-term deadlines.. Python is my prefered choice because I can deliver fast. However, how can I overcome the speed barrier? That’s why I decided to take advantage of PyPy, a fast, compliant alternative implementation of the Python language.
In this talk, I will present some examples of applications in the field of Algo-trading which need to process data lightning fast, and I will focus in how I optimized my solutions using Python and PyPy.
The examples will be taken from the finance/trading world, including how I built and improved a FIX-protocol parser, and how I managed to consume a data feed of all exchanges quotes (Bid / Ask) without having gaps in communication nor dissection.
I will explain what were my major obstacles, how I managed to observe the bottlenecks in the system, monitor them, and finally how I managed to improve them.
The optimizations that will be shown in my talk, will take place in the JIT world of PyPy, including ways to write your code for the PyPy’s JIT, and in addition, I will show some tweaks I have done to make the Garbage Collector (CG) work much better in my environment. In addition, we will see how choosing the right data structure for our needs, improves the overall latency in the system.