Realtime Graphing (again)

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)

  1. john wrote:

    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 :-/

    Monday, August 9, 2010 at 1:13 pm #
  2. chergert wrote:

    I’m not sure I have the time to do so, but I would love to help someone do that.

    Monday, August 9, 2010 at 1:24 pm #
  3. Benjamin Otte wrote:

    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.

    Monday, August 9, 2010 at 5:57 pm #
  4. chergert wrote:

    I’ll try to do that tonight and provide cairo traces and micro benchmarks on a few sets of hardware.

    Monday, August 9, 2010 at 6:10 pm #
  5. chergert wrote:

    Circular

    AVERAGE: 0.000235843
    MEDIAN: 0.000182076

    Copying

    AVERAGE: 0.0002552240
    MEDIAN: 0.000207848

    Monday, August 9, 2010 at 9:26 pm #
  6. Benjamin Otte wrote:

    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. :)

    Tuesday, August 10, 2010 at 4:10 pm #
  7. john wrote:

    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 …

    Wednesday, August 25, 2010 at 8:23 pm #