[racket] Typed Racket startup time

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sun Aug 28 21:54:45 EDT 2011

If you (presumably manually) apply the diff below and then restart
drracket you can see timings (note that you should start drracket from
a command.com shell via "racket -l- drracket" since some of the
numbers are sent to drracket's stdout instead of the repl). I did that
and I do see a much bigger difference between what is happening in
drracket and what happens with that command in the shell:

typed/racket: 3635 msec
racket:        109 msec
racket/base:     0 msec

Looks like this is most of the time:

#lang racket/load
(time (begin (eval '(module x typed/racket))
             (eval '(require 'x))))

I get 2700 or msec each time I do that on my machine. Still one
unexplained second, but at least somewhere to start.


diff --git a/collects/drracket/private/unit.rkt
index 547643f..2157a87 100644
--- a/collects/drracket/private/unit.rkt
+++ b/collects/drracket/private/unit.rkt
@@ -2646,7 +2646,7 @@ module browser threading seems wrong.
           (send interactions-canvas focus)
           (send interactions-text reset-console)
           (send interactions-text clear-undos)
+          (printf "before ~s\n" (current-process-milliseconds))
           (let ([start 0])
             (send definitions-text split-snip start)
             (let* ([name (send definitions-text get-port-name)]
@@ -2663,6 +2663,7 @@ module browser threading seems wrong.
                       (<CE><BB> ()
+                        (printf "after ~s\n" (current-process-milliseconds))
                         (send interactions-text clear-undos))))))))

       (inherit revert save)

On Sun, Aug 28, 2011 at 8:38 PM, Shriram Krishnamurthi <sk at cs.brown.edu> wrote:
> I'm in DrRacket 5.1.3 on Windows 7. I don't know how to report a precise
> time - is there a way? Absent that I've been going by wall clock and feel.
> I can't think of anything I've done that ought to cause my zo's to be
> outdated. If you don't see the same effect, I can install a vanilla version
> tomorrow or so and see whether its the fault of my configuration. (Can't do
> it tonight - Irene knocked out Internet access.)
> (And until I confirm that, I shouldn't have called it a ux bug. Sorry.)
> --
> Pardon terseness and mistakes -- sent from phone.
> On Aug 28, 2011 8:25 PM, "Robby Findler" <robby at eecs.northwestern.edu>
> wrote:
>> FWIW, this is a way to time what you're saying (I believe -- assuming
>> you have all your .zos built and you're using a fresh drracket) and
>> the difference is not as great as that. Unless maybe there's some
>> reason why that test is different?
>> Last login: Sun Aug 28 11:50:09 on ttys001
>> [robby at gaoping] ~$ time racket -l racket
>> real 0m0.660s
>> user 0m0.368s
>> sys 0m0.118s
>> [robby at gaoping] ~$ time racket -l typed/racket
>> real 0m1.031s
>> user 0m0.719s
>> sys 0m0.168s
>> [robby at gaoping] ~$
>> On Sun, Aug 28, 2011 at 7:20 PM, Shriram Krishnamurthi <sk at cs.brown.edu>
>> wrote:
>>> In a blank #lang racket buffer, if I hit F5, I get a repl cursor almost
>>> instantaneously. If I do the same in typed/racket, it takes roughly three
>>> seconds every time. This can't be blamed on parse time since the buffer
>>> is
>>> empty! What gives? (And Sam, do you regard this as a ux bug?)
>>> --
>>> Pardon terseness and mistakes -- sent from phone.
>>> _________________________________________________
>>>  For list-related administrative tasks:
>>>  http://lists.racket-lang.org/listinfo/users

Posted on the users mailing list.