-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Playground warmup is very slow #459
Comments
I did some debugging of this a while ago (I think it's the same issue that's affecting our doctests). You can gdb attach to the process and get a stack trace, which I think indicated that it was definitely something in module loading. However, I also had a look and I'm pretty sure we're using dynamically linked libraries, but I'm not an expert on this so I might have got this wrong (I think I just looked at the output of ldd on things, and it looked like there were lookup paths). |
Hmm, currently we can't use ghc 8.6 because of eskimor/servant-subscriber#19 so I will try a hint-only project to see at least if this will solve it in the future. Try ghci first though. |
If that's the only blocker we could fork and fix, and add the fork as a git dependency. |
So, with servant subscriber fixed (I have submitted a PR) we are now blocked by https://ghc.haskell.org/trac/ghc/ticket/16104 which will no doubt take quite a few months before it is available to us (we want it in a stackage LTS really). See #461 I will move on to GHCI |
so on a machine where the server warmup takes almost 1 minute, ghci loads files in less than 1 second and takes less to start up. This is using the same ghc lib dir as hint is using. The only difference between this test and hint is that hint is running within a Haskell process which maybe causes some contention in the way ghc is loading things. I think this test is successful enough to move on to trying to embed ghci in the haskell server and see what happens. |
Yes, that makes sense - it's also the case that I've been able to use ghci-as-a-process just fine in the projects where the doctests are slow, so it does seem to be something about using it as a library. |
This is bizarre in so far as |
Currently I'm actually looking at |
This is fixed by moving from hint to runghc |
This is now merged, tested and pending release. See #514. |
FWIW, the other workaround is to compile the executable which uses the GHC API using |
@mpickering oh really, wow. I think runghc is currently a better solution anyway as it allows spawning as many processes as we require and seems to have almost no overhead. |
@mpickering can you explain why? or is it just magic :D |
It's not clear yet but it's something to do with using the system linker vs the linker built into GHC. |
We are being affected by haskell-hint/hint#56 so I will look into:
The text was updated successfully, but these errors were encountered: