On Friday, April 28, 2017 at 2:47:41 AM UTC+8, Dupéron Georges wrote:
> Thank you Matthew for the explanation.
> 
> If I understand correctly,
> 
> * Alex Harsanyi's start-up time is due to run-time (phase 0) initialisation 
> code in the required libraries, including things like (define v 
> costly-expression), which look like they could be saved as constants, but 
> actually involve running the expression.
> 

I actively try to avoid this case and I believe the program has little or no 
such code anymore.  However, even when I removed such cases, it did not seem to 
make much difference.  Racket code actually runs fast.

> * If Alex Harsanyi's code uses dynamic-require or eval, the phase 1 
> initialisation code of the required libraries is executed when eval or 
> dynamic-require are first invoked.

The code does not use any of those things.  Also, apart from 3 macros dealing 
with baking in some API KEYS at compile time, there are no uses of 
`define-syntax` and friends.

> * The size of the bytecode does matter (and switching to Chez scheme's 
> run-time could hopefully improve that)

All the .zo files put together are about 4Mb.  I'm not sure if this is big or 
not?

What I'm wondering is if class definition actually runs some code when a module 
is required, like the code below:

    (define my-class% 
       (class object% (init) (super-new)
          (define/public (say-hello) (printf "hello~%"))))


In the end, the start up time does not bother me too much, as it is a GUI 
application and I spend a lot of time using it after starting it up, so the 7 
second wait is acceptable. I have other, more interesting, application features 
to work on anyway :-)

If anyone wants to look at the startup time, or help out with any other 
development, here is the application:

    https://github.com/alex-hhh/ActivityLog2

Best Regards,
Alex.

-- 
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