Hi Robby

While that works for my minimal test with a single bitmap, the behavior
still occurs for composite constructions. New sample code below:

DrRacket, version 6.5.0.4--2016-05-16(2109b26/a)

displayln: 0 milliseconds
result: 1838 milliseconds


Cheers

Dan

#lang racket

(require 2htdp/image)

(define harpos (bitmap/url "
http://3.bp.blogspot.com/-_PE5YujeDKk/VcP3vpTgJZI/AAAAAAAAGpE/97T8sdMj6CE/s640/harpo-tryptych.png
"))

(define h (scale 1/10 harpos))
(define v (rotate 90 h))

(define H (above h h h))
(define V (beside v v v))

(define R1 (apply beside (make-list 10 H)))
(define R2 (apply beside (make-list 10 V)))

(define G (above R1 R2 R1 harpos R2 R1 R2))

(define a (current-milliseconds))
(displayln G)
(define b (current-milliseconds))
(~a "displayln: " (- b a) " milliseconds")

(define c (current-milliseconds))
G
(define d (current-milliseconds))
(~a "result: " (- d  c) " milliseconds")




On Mon, May 16, 2016 at 8:21 AM, Robby Findler <ro...@eecs.northwestern.edu>
wrote:

> I've pushed a fix that reorders the cases in the code that handles
> printing so that you should see similar performance for these two now.
> I'm not completely confident in the change but let me know how it
> works for you.
>
> Robby
>
> On Sat, May 14, 2016 at 4:41 PM, Daniel Prager
> <daniel.a.pra...@gmail.com> wrote:
> > Displaying bitmaps in DrRacket using 2htdp/image is near instantaneous
> when
> > (display)-ed, but takes quite a while when shown as a result.
> >
> > The effect gets very bad when lots of images are combined with (beside)
> and
> > (above), while (display)-ing remains fast.
> >
> > Racket version is 6.5.
> >
> > Dan
> >
> >
> >
> > Sample comparison:
> >
> > displayln: 1 milliseconds
> > result: 714 milliseconds
> >
> >
> > Code:
> >
> > #lang racket
> >
> > (require 2htdp/image)
> >
> > (define harpos (bitmap/url
> > "
> http://3.bp.blogspot.com/-_PE5YujeDKk/VcP3vpTgJZI/AAAAAAAAGpE/97T8sdMj6CE/s640/harpo-tryptych.png
> "))
> >
> > (define a (current-milliseconds))
> > (displayln harpos)
> > (define b (current-milliseconds))
> > (~a "displayln: " (- b a) " milliseconds")
> >
> > (define c (current-milliseconds))
> > harpos
> > (define d (current-milliseconds))
> > (~a "result: " (- d  c) " milliseconds")
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to racket-users+unsubscr...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to