Skip to content

Skip sleep(0.01) for non-change triggered Revise.revise() #838

@frankier

Description

@frankier

Revise.revise() is typically used in one of two ways:

  • Called just before code is executed (non-change triggered)
  • Called when files are modified (change triggered)

Revise.revise() does a sleep(0.01) in either case

sleep(0.01) # in case the file system isn't quite done writing out the new files

This is clearly a bit of a hack in the first place, but it does make sense that it might help for change triggered Revise. However, if Revise.revise() is being run in a non-change triggered scenario, there is no reason to think 10ms from now is any better than now. Some non-change triggered uses of Revise, such as the REPL hook, mitigate this by guarding Revise.revise() with isempty(revision_queue), however even if there are revisions, is there any reason to wait 10ms extra in this scenario? It's not so long, but latency adds up.

The simplest solution would be to add a flag e.g. Revise.revise(...; ... skip_sleep=false), and change all non-change triggered usages to set it to true.

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