Re: penalty for double buffering



Owen Taylor wrote:
Well, glancing at the code briefly, certainly there is no reason
to use double buffering if you are already saving using a backing
pixmap, as you are in your code.

OK, good. That answers a question and solves a problem.

But I wouldn't expect any significant performance impact assuming
that you have sufficient video memory. The extra copy inside the
video card will basically be free.

If you want to investigate further what is going on, I'd suggest
that the first step would be to create a small test case independent
of your application that does essentially the same thing.

I may try that over the holidays. My motivation is diminished now that
the problem is solved :-).

If I had to make a random guess, my guess would be that there is
some pathology lurking in the way you are handling refreshes by
recursing the main loop (which is... err... odd) and that small
differences in timing are resulting in big differences in the
amount of drawing you are doing.

Just to clarify: there's no recursion. There is a top-level loop that
interleaves input/output processing, drawing and
gdk_window_invalidate_rect() calls, and gtk_main_iteration() calls.
GTK+-based graphical output is a compile-time option, so I can't use gtk_main() at the top level.

The test case is playback of recorded data from a file. The timing is deterministic and the area exposed is identical for every input data point.

Steve




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]