Yesterday, we spent the day on a report that our influx parser was slow, and it turns out it was indeed.
This is an exciting topic as a few days ago, we gave a talk at BoBKonf 2020 on this topic, so this is a great opportunity to show some of the topics and our process in action.
All the topics in this blog are links; the main one above this text is to the pull request, the titles of each section link to the commit that implements the topic discussed. Go ahead, click on some, and take a look!
There are two tools worth introducing here that we used during this performance session.
One is perf, which we used with a minimal setup of
perf record and
perf report. We use this to get a glance at where code is spending time. This is not perfect, but it is quick for decent results.
The other one is criterion, an excellent Rust framework for microbenchmarks based on the haskell framework with the same name. It is so helpful since it allows us to show changes in performance between changes. That makes it perfect for the kind of incremental improvements our process favors.