[racket] speeding up db.plt loading

From: prad (prad at towardsfreedom.com)
Date: Sun Sep 2 18:51:06 EDT 2012

Danny Yoo <dyoo at hashcollision.org> writes:

>>
>> if i raco my program and run the executable i can get results within 1s,
>> but running the program through racket can sometimes take nearly 5s
>> before i see the same results. if i don't load db.plt i get responses
>> instantly (but of course i have no access to the db).
>
> Hi Prad,
>
>
> I want to follow up on this particular issue: it's very possible that
> this particular PLaneT package was not properly compiled upon
> installation.
>
> It's very easy to have PLaneT packages half-installed by accident, and
> the result is insidious: the packages will load, but they will take a
> long time to do so!
>
> If you don't mind, can you try doing the following?  Can you use the
> 'raco make' command on your previous executable?  'raco make' is the
> command I use to compile my programs so that they load faster at
> runtime.  (See: http://docs.racket-lang.org/raco/make.html for more
> details.)
>
> If the PLaneT package hasn't been compiled, using 'raco make' on your
> program should be enough to force the PLaneT package to compile.
>
> See if using 'raco make' first on your program speeds up its load-time.
>
> Good luck!
>
hi danny!

i did the 
raco make

and the .dep and .zo files appeared in the compiled directory.

then i ran the program both as
racket PROG.rkt
./PROG.rkt

understandably no detectable difference between the above two.

however, both were considerably slower than using
(require db/base db/sqlite3)
as neil had suggested.

so i assume that things did compile ok.

(one of my programs is slow even using neil's suggestion, but i imagine
it's because i've coded it poorly - so i'll re-examine it further.)


-- 
In friendship,
prad

                                      ... with you on your journey
Towards Freedom
http://www.towardsfreedom.com (website)
Information, Inspiration, Imagination - truly a site for soaring I's

Posted on the users mailing list.