-
Notifications
You must be signed in to change notification settings - Fork 111
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
Skip sleep(0.01) for non-change triggered Revise.revise() #838
Comments
Can you give me more information about the non-change triggered uses? I pretty much only use it in the change-triggered case myself. Is this about |
Here e.g. Lines 1232 to 1245 in 891b739
This means that in this case Here is my reasoning in a bit more depth: My understanding is that the short sleep is really a heuristic to deal with the situation that changes to the filesystem are often non-atomic in practice and bursty like so:
In the case of
We try and fix this by consolidating the multiple events into a single one. This is sometimes called debouncing. There are different ways we could debounce, but given that each burst is probably short, and they have relatively long gaps between, just waiting a short time after the first one seems reasonable. It might be that this is not logically part of the job really the job of In the case of e.g.
In this case, the short sleep doesn't appear to help. Note also that the larger context of this issue (debouncing of fs-changes) has to be considered together with #837 . The current approach of sleeping during the not waiting period seems to depends on later events in the filesystem burst being lost. |
Revise.revise()
is typically used in one of two ways:Revise.revise()
does a sleep(0.01) in either caseRevise.jl/src/packagedef.jl
Line 751 in 13a5eb7
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 guardingRevise.revise()
withisempty(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.The text was updated successfully, but these errors were encountered: