[racket-dev] Universe double buffering

2010-09-02 Thread Nadeem Abdul Hamid
Why doesn't 2htdp/universe use double-buffering?

--- nadeem
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Universe double buffering

2010-09-02 Thread Matthias Felleisen

Why do you think it doesn't? 




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

_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Universe double buffering

2010-09-02 Thread Nadeem Abdul Hamid
> 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
http://cs.berry.edu/~nhamid/
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] Universe double buffering

2010-09-02 Thread Robby Findler
It sounds like there is also a performance problem there too. If you
don't mind supplying a program for us to play with to see if we can do
better, that would be helpful (but no promises ).

Robby

On Thu, Sep 2, 2010 at 8:15 AM, Nadeem Abdul Hamid  wrote:
>> 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
> http://cs.berry.edu/~nhamid/
> _
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev
>
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Re: [racket-dev] Universe double buffering

2010-09-02 Thread Robby Findler
What happens if you restart drracket and try the same program again?
(If the double buffering appears to come back I think I know what
happened.)

Robby

On Thu, Sep 2, 2010 at 8:15 AM, Nadeem Abdul Hamid  wrote:
>> 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
> http://cs.berry.edu/~nhamid/
> _
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/dev
>
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev

Re: [racket-dev] Universe double buffering

2010-09-02 Thread Nadeem Abdul Hamid
It still behaves the same. I can literally capture a screenshot of the
canvas at any point where only a portion of the pictures have been
drawn on it.


On Thu, Sep 2, 2010 at 9:53 AM, Robby Findler
 wrote:
> What happens if you restart drracket and try the same program again?
> (If the double buffering appears to come back I think I know what
> happened.)
>
> Robby
>
> On Thu, Sep 2, 2010 at 8:15 AM, Nadeem Abdul Hamid  wrote:
>>> 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