Open samth opened 4 years ago
Just coping and pasting this image into DrRacket made my instance of drracket go crazy. I started 4 minutes ago and it hasn’t calmed down yet.
— I can’t navigate inside the editor window with key strokes
— The wheel keeps spinning.
— alt-tab doesn’t bring my drracekt back and forth in a second but in 10 or 15 seconds.
— running (define plane …)
takes a minute. The wheel keeps spinning.
— I haven’t added your program yet .. because I can’t.
Are you sure this is an htdp issue? Tony reported serious graphics issues with CS.
I was able to insert (freeze ..) around the scaled image and things look almost normal now, after drracket loads the program.
I eventually let things calm down enough to run my program, and got the behavior I described. I agree that there seem to be DrRacket-related issues as well (cc @rfindler).
This is Racket BC.
This is Racket BC.
What version? I fixed a performnace bug in universe
for the spring semester.
This was 7.7. I haven't tested 7.8 yet, I'll try tonight.
On Mon, Aug 24, 2020, 6:14 PM Matthias Felleisen notifications@github.com wrote:
This is Racket BC.
What version? I fixed a performnace bug in
universe
for the spring semester.— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/racket/htdp/issues/105#issuecomment-679393455, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB3X4433I5Q7ZU7A2EOKXLSCLQ3NANCNFSM4QJZCW4Q .
-- To unsubscribe from this group and stop receiving emails from it, send an email to samth+unsubscribe@plt-scheme.org.
This looks like one of those situations where it may turn out to be many separate things that need improving. It looks like one of them is saving the file. DrRacket does an autosave pretty quickly after the paste and it takes a long time. Here's some code that just does that part, demonstrating what's slow. I think the autosave timeout is shorter than the time that the saving takes, which compounds things significantly.
#lang racket/gui
(define t (new text%))
(printf "0\n")
(define bmp
(time (make-object image-snip% "airplane.jpg")))
(printf "1\n")
(time (send t insert bmp))
(printf "2\n")
(time (send t save-file "airplane.rktd"))
(printf "3\n")
This commit is one piece of the puzzle (meant to note the connection in the commit message but forgot): https://github.com/racket/gui/commit/e947d596bb1eefcc660740a1ba0146188e0e1fc4
With the latest set of commits, the time it takes to call save-file
in the code above goes from 12 seconds to 20ish msec. This matches the time to save in DrRacket when the airplane image is inserted via file|insert image, but when it is pasted in, I see about 5 seconds for the first time the file is saved and then 1ish seconds after that (because there isn't enough information in the paste data (at least that I know how to get) to take the very fastest path).
With a program with a very large image in it, DrRacket become extremely sluggish, and
animate
seems to show only a black square some of the time.To reproduce, in Beginning Student: