Discard anticipated filesystem events #727
Description
The performance benefits from #700 are muted somewhat by the fact that the git operation cache evictions from filesystem events are broader than those from the operations that trigger them. For instance, when staging a line from a file, we cache the results from the status and patch generation calls, but then immediately evict them when the resulting .git/index
filesystem event arrives:
In the worst case, the filesystem event arrives before the automatic render completes, which prompts React to group the resulting state changes into a single, slower render.
The solution is to predict the filesystem events that will be produced by any invalidating Repository action and perform no cache evictions or didUpdate
events. We'll likely want to bound the prediction with a timeout of a second or two to avoid ignoring too much.