[racket-dev] Universe double buffering

From: Nadeem Abdul Hamid (nadeem at acm.org)
Date: Thu Sep 2 09:15:40 EDT 2010

> Why do you think it doesn't?

(I'm assuming you mean: "What makes me think that it is not
double-buffering?") ...

I have a list of 15 thumbnail images of people and a function that
places pairs of them side by side, using above/beside to create a 133
x 581 image. i.e.
   choose-and-show-pairs : (listof image) -> image

Now, when I do:
(big-bang PIC-LIST
          (on-draw choose-and-show-pairs))

I see each individual image getting laid out, one by one, rather
excrutiatingly slowly. The choose-and-show-pairs actually randomizes
the pairing up, and so if I move the mouse over the canvas, apparently
the redraw handler is called, so I see a new set of pairs getting laid
out, very slowly.

I would have expected a double-buffered implementation to lay out the
images in memory on some bitmap buffer and then quickly transfer the
bitmap buffer to the canvas, so you don't actually witness the effect
of all the above/beside operations happening.

> On Sep 2, 2010, at 8:52 AM, Nadeem Abdul Hamid wrote:
>> Why doesn't 2htdp/universe use double-buffering?
>> --- nadeem
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://lists.racket-lang.org/listinfo/dev

Nadeem Abdul Hamid
Associate Professor, Computer Science
Berry College
PO Box 5014
2277 Martha Berry Hwy NW
Mount Berry, GA 30149-5014
(706) 368-5632

Posted on the dev mailing list.