Replies: 4 comments
-
It's a problem we are aware of, but the low-hanging fruit have been picked. On my laptop from 2019 the numbers are: 0.48s user I expect newer systems to be faster. Note that the startup time will be neglible when the script actually has work to do. If you find the problem large enough, a potential solution, you could explore:
This solution is/was used by Emacs: Would it be ok to close this again? |
Beta Was this translation helpful? Give feedback.
-
One of the obstacles to a fast startup time in Racket is that a lot of things are expected to be available in all contexts, like |
Beta Was this translation helpful? Give feedback.
-
One difference to note when running code from a file is that Guile has auto-compilation enabled by default, which is equivalent to using the new-ish More broadly, the Guile developers have put particular effort into startup time, and it has paid off. Nonetheless, many of us do write scripts in Racket! I was surprised when I tried this that passing a program with
(My |
Beta Was this translation helpful? Give feedback.
-
I'd like to get into Racket as a Scheme user, but its high startup times are a blocker for me:
$ time racket -e '(display "hello")'
hello
real 0m0.721s
user 0m0.598s
sys 0m0.119s
This basically rules out using it for command line scripts, which is a major class of uses for me.
Some have suggested using
#lang racket/base
andraco make
to reduce the time. This reduces execution time to 0.175s. However this is still worse than Python and Guile, which manage 0.033s and 0.022s respectively, neither of which need a precompile step (which would make this kind of usage impractical).Could this be improved in a future Racket?
Beta Was this translation helpful? Give feedback.
All reactions