As a followup to this I opened issue 2278 because of a difference between dynamic-place
behaviour when ran through racket and when embedded. https://github.com/racket/racket/issues/2278
Do you know of a workaround for this? I am walking towards a deadline for a delivery and would be great if I can jump this hurdle.
I don’t support you’re building your own Racket build? In that case, you could hack around this limitation by making is_predefined_module_path
in “place.c” always return 1.
Otherwise, the only idea I have is to shift everything to collection-based paths. That is, instead of using a file
relative path in define-module-path-index
, use a path that refers to the module through a collection name.
I might be able to look into the problems and potential improvements in another day or two.
Does anyone have experience with a (free-as-in-beer) CI for Racket packages that includes Windows builds? (e.g. AppVeyor, Azure Pipelines, maybe Bitbucket pipelines) I’ve used Travis a bit via @greg’s great template, but, especially since I am really not a Windows person, I would love to set up similar testing to check for Windows-specific issues.
@philip.mcgrath I wrote the AppVeyor code, so I can maybe answer questions about that
@samth Do you mean the one for Racket itself? I’ve seen that, and the fact that it is basically understandable gives me hope that this is in reach. The part I’m least sure of it that I believe https://github.com/racket/racket/blob/master/appveyor.yml compiles Racket from scratch, whereas I assume it would be better for a package to do something more like https://github.com/greghendershott/travis-racket/blob/master/install-racket.sh and install a pre-built Racket—but I’m not really clear how you would do that on Windows.
yes, that’s right, and I agree that you need to run the installer from the command line, and unfortunately I don’t have any more knowledge offhand of how to do that
@yasserhussain1110 has joined the channel
@samth @philip.mcgrath there are builds of “Minimal Racket” on Windows packaged as tarballs instead of installers; just unpack and run. They’re available for the release versions (click the “More Variants and Checksums” link) and from the Utah nightly builds.
What are good ways to diagnose slow startup time for Racket projects? Herbie takes ~12s to start up on my machine, which seems far too slow.
(Plus, in the REPL with xrepl, it sometimes seems to loop forever instead of loading a module at all, which ideally I’d also like to fix.)
@pavpanchekha Is that with everything pre-compiled to zo files?
No, without pre-compilatino
It is faster, of course, with pre-compilation, but still slow
Then I would just say “run raco make first”
On a personal level, pre-compilation is a pain because it makes developing on multiple machines difficult (different Racket versions)
So far I have preferred waiting out the startup time than pre-compiling
as in you have a shared home directory and multiple racket installs?
Yes
It also makes Geiser in Emacs unhappy for reasons I do not understand…
this may not seem like the most helpful answer, but I would just not do that
but in terms of profiling, here are two ideas:
- to profile macro expansion, do
(profile (dynamic-require "herbie.rkt" #f))
Good idea!
- to measure startup time after compilation you can do the same thing
but that won’t help that much if most of the time is spent actually loading code
in that case, I’d roughly add logging in each file so you see when it’s run
and at what timestamp
(For reference, startup with compiled everything is ~10× faster)
For #1, I do get a profile, is there anything in particular in it I should be looking for?
I don’t see anything that I recognize as my code with more than 1% of runtime spent there…
Re: a shared home directory with multiple Racket installs, if you set PLTCOMPILEDROOTS
to compiled/@(version):
, then Racket will store bytecode for different versions of Racket in separate directories, which allows them to coexist.
Huh
I’m not entirely clear why this isn’t the default.
I suppose a slight tweak can also make those directories hidden
Oh wow I never knew that. Now I’m curious, may the value of PLTCOMPILEDROOTS
be any valid at-expression, or just this special syntax? Are there other env vars like this?
It’s special syntax. It’s documented here: http://docs.racket-lang.org/reference/eval.html#%28idx._%28gentag._246._%28lib._scribblings%2Freference%2Freference..scrbl%29%29%29
Thanks! I did actually rtfm after I typed that. :slightly_smiling_face: I guess I was also jumping ahead to wondering if a little wrapper around getenv
that handled at-expressions would be a clever or terrible idea for some things I’m doing.
@pavpanchekha can you paste the profile output?
@pavpanchekha is that with or without precompilaiton?
Without
that mostly just looks like general macro expansion
does herbie have any macros that take a long time or do a lot of work?
We barely use macros, and I think all of ours are define-syntax-rule, so don’t do significant computation
ok so then it’s pretty surprising that it takes so long to compile
@samth Inspired by your second suggestion, I’ve also made a little file that dynamic-requires every Herbie file, in dependency order, and records how long that takes. It seems to be pretty flat, though the racket
and math/flonum
libraries also take a significant time.
If I pre-compile, then it’s only a few libraries that take time, the two above being the major ones
loading racket
should be very fast
so that surprises me
~400ms
More precisely, executing the following:
(define t (current-inexact-milliseconds))
(dynamic-require 'racket #f)
(display (number->string (- (current-inexact-milliseconds) t)))
(newline)
Outputs a 200–400ms
so for me time r -l math/flonum -l racket -e 1
is consistently about 1.2 sec
Yeah, that’s about right for me as well
That explains the ~1.5s startup time with Herbie precompiled, then
do you need full racket
, as compared to racket/base
+ some specific libraries?
A few years back I did try to convert to racket/base, but I found that we use a pretty significant chunk of it
I should also note that some of the more expensive libraries we use (like plot and web stuff) is hidden behind a lazy-require, so isn’t part of these numbers, but substantially slows down startup if invoked
In scribble/base
, is it safe to (require (only-in scribble/manual codeblock)
?
@mflatt hi again, while I was developing the test cases for the above issue, I noticed other problems I thought I should bring to your attention, though I think best to email you instead. Ok to use your http://utah.edu\|utah.edu address or is there another email address you prefer me to use instead?
That’s the best address
ok
@kykim has joined the channel
Racket could use more mentors and maintainers at http://exercism.io\|exercism.io. For anyone who isn’t familiar, Exercism has small programming exercises with a focus on incremental improvement through community feedback.
Since the newest version of the site recently launched there’s a core sequence of several exercises which, at least starting out, require feedback from a language-specific mentor to progress. I and perhaps many others are currently blocked on the core track. Efforts like this could help people ramp up with Racket more productively and reinforce idioms. If there are alternative ways for hobbyists to get this sort of feedback outside the classroom setting I’d love to hear about it. After using Racket more and hopefully getting feedback on my code I will consider becoming a mentor on Exercism.
Relevant links: - https://exercism.io/about - https://exercism.io/tracks/racket - http://mentoring.exercism.io - https://exercism.io/become-a-maintainer
@jacob.d.mitchell Is the relaunch related to Exercism becoming part of the “portfolio” of Thalumus? https://thalamus.ai/portfolio The other companies seem to be teaming up with “experts” to do “AI”. Exercism seems different… or is it?
Good question, @greg. This is the first I’ve heard of Thalamus.
Concrete motivations and design decisions for the new version of the site are described at https://exercism.io/about-v1-to-v2. It provides more context on the mentor situation as well. In v1 everyone could mentor on any exercises for which they already submitted a solution, but now they’re ensuring core track feedback comes from those who explicitly want to mentor.
@pavpanchekha For speeding up compile times across multiple machines, you can configure raco pkg
to download precompiled bytecode from the package build server so you don’t have to recompile packages you depend on, and you can skip installing build dependency packages entirely. See the --binary
and --binary-lib
flags to raco pkg install
, as well as the Built-Package Catalog section of https://pkg-build.racket-lang.org/about.html
Thanks, @notjack. By the way, will you be at RacketCon?
yup!