Skip to content

Consider defaulting to --debounce=0s on Linux #356

@georgefst

Description

@georgefst

Describe the feature you’d like to be implemented

On trying out ghciwatch for the first time, I was surprised to find that it felt noticeably less snappy than ghcid. It turns out this is because reloads are delayed by half a second for debouncing purposes. This is unnecessary on Linux (and possibly BSDs etc. ?) since inotify reliably sends a single CLOSE_WRITE event when a file is written to disk. From my own past experiments with exec-on-save behaviour, I have found that other common OSs are disappointingly unsophisticated, which is what makes debouncing necessary.

List alternatives to the feature and their pros and cons

  • Look in to what exactly ghcid does.
  • Reduce the default debounce interval across the board. I seem to remember I tested pretty thoroughly on Windows and MacOS before deciding 0.1s was safe here.

Additional context

From the fact that --debounce=0s works perfectly fine on my Linux machine, in that ghciwatch doesn't attempt to reload twice, I'm assuming that the Rust file watching library being used is already delegating to CLOSE_WRITE on Linux. I haven't actually checked this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    linearCreated by Linear-GitHub Sync

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions