As suggested by Benjamin, I switched UberGraph to use a single GdkPixmap instead of two. Previously I copied the content back and forth between Pixmaps as I added the new second's worth of data. That wasted memory in X as well as being unnecessary. Now it uses a single GdkPixmap as a circular buffer and blits in two steps (no fear, as we get double buffering for free from gtk).


Comments (7)
Impressive work.
Any chance some of these improvements might end up i G-S-M for 2.32?
It has been a sore spot for too long :-/
I’m not sure I have the time to do so, but I would love to help someone do that.
Did you benchmark the two approaches?
I’d be interested in knowing if there’s any huge differences between the two, as I’ve never done this myself.
I’ll try to do that tonight and provide cairo traces and micro benchmarks on a few sets of hardware.
Circular
AVERAGE: 0.000235843
MEDIAN: 0.000182076
Copying
AVERAGE: 0.0002552240
MEDIAN: 0.000207848
Nice to know that the ringbuffer approach is not just less memory hungry, but also faster.
Even though it’s just a tiny little bit.
Otte: It might be small numbers but it is still worth some
7,6% average
12,4% median
hopefully this impressive work might end up i G-S-M some how, some day, some way …