I did a bit more work on the real-time graphs during my current vacation. It has resulted in being a whole lot smoother. Primary fixes were:
- Graph tracks time rather than "available buckets" for data points. It works so much better I feel stupid for not doing it in the first place.
- Use floating point for positioning throughout pipeline until last possible step.
- Render updates in thread and only blit to cairo xlib surface in main loop. This probably isn't technically safe at the moment as reference counting of images in libpixman aren't thread aware. However, it seems to work pretty well for a single rendering thread. Once that is fixed, we can scale up rendering to more threads (which helps a bit if you have a lot of visualizers in perfkit).
- Not really a performance/smoothing fix, but the renderers are abstracted more from the graph. This means the visualizers and realtime graphs in perfkit share rendering code.
It also now works on gtk+ 3.0. Obligatory screencast below.