Visitar URL original
Reload very slow on project, instant in ghci · Issue #355 · ndmitchell/ghcid · GitHub
Skip to content

Reload very slow on project, instant in ghci #355

Open

Description

@seanhess

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:

Activity

  1. ndmitchell commented on Mar 26, 2022

    @ndmitchell
    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.

  2. archaeron commented on Apr 11, 2022

    @archaeron

    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?

  3. mjrussell commented on May 21, 2022

    @mjrussell

    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

  4. ndmitchell commented on May 22, 2022

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions