Skip to content
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

Reload very slow on project, instant in ghci #355

Open
seanhess opened this issue Mar 2, 2022 · 4 comments
Open

Reload very slow on project, instant in ghci #355

seanhess opened this issue Mar 2, 2022 · 4 comments

Comments

@seanhess
Copy link

seanhess commented Mar 2, 2022

I have an older project that I recently opened up to perform some updates. My new workflow includes ghcid, but reloads are too slow to be usable.

When I first run ghcid it compiles all the modules, as expected. However, when I save a file, ghcid takes about a minute to update. If I run the project in GHCI it reloads instantly.

Any idea what is going on?

Here is more info if it is helpful:

@ndmitchell
Copy link
Owner

If you run stack ghci --test --bench --no-load --ghci-options=-fno-code --ghci-options=-fno-break-on-exception --ghci-options=-fno-break-on-error --ghci-options=-v1 --ghci-options=-ferror-spans --ghci-options=-j does it go equally slow? If it does, then that's odd, as that's all ghcid is doing. If it doesn't, try removing options one by one. It might be that -j upsets Rosetta in some way. If you can find a command that works nicely, using -c the_command explicitly should fix ghcid, and I'd be keen to add whatever is the problem to the docs.

@archaeron
Copy link

archaeron commented Apr 11, 2022

it's also very slow for me. And I thought it might be faster if I set the polling to 1 (--polling=1)

The weird thing is that sometimes it works as intended and very quickly and then it can break on save and not work again after reloading.

Could it be that newer GHC changed the output format of warning and errors?

Altough the same project works great on linux, so maybe on mac the format is different?

@mjrussell
Copy link

Im seeing also slower times from ghcid compared to stack ghci or stack repl. I noticed with the --test flag, it looks like its no longer interpreted, i.e its missing , interpreted ) at the end of each file.

Totally possible this has been the behavior in ghcid for a while, but wanted to throw that out there

@ndmitchell
Copy link
Owner

Changing the polling probably won't help, but it could make things worse, as if you don't pass that, it uses inotify which is very likely to be faster. I don't think the Mac format is different, but GHC does regularly tweak the format. If you pass --verbose to Ghcid it might give you clues about what is happening. Ghcid runs a command line, so you probably need to compare the command line it uses vs the one you are comparing. If you pass -c "stack ghci" then you can have it use stack ghci itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants