I've been having performance issues with my charting code when the market goes crazy. The problem is that plotly requires to redisplay each and every point on every update, at least when it is run in a Jupyter notebook (I have built my UI/monitoring in Jupyter widgets.)
So I went down the path of trying out various different libraries and found some promising candidates. But before I went down the path of learning all their stupid little problems I sat and thought about whether I truly need every single tick to be reflected in the chart. The answer is no, I can wait for 1 second. So I update the chart to update once per second. Voila, no more problems.
Keeping it simple! CPU usage down from 100% CPU to 40% CPU. Of course I'd like to solve this problem eventually but for now it's OK.
Edit: the code, for completeness: