Simple caching to keep editor responsive over slow network connections #152

Merged
merged 1 commit into from Jul 1, 2012

Conversation

Projects
None yet
2 participants
@jotson
Contributor

jotson commented Jun 30, 2012

Implements a simple caching mechanism for git_root() to keep the editor responsive when editing files over slow network connections (over an SSH mount, for example).

git_root() is called for each command and may stat several directories on each call. On a slow network connection, the editor can become completely unresponsive for long periods.

These changes cache the result for a single call to git_root() for 5 seconds. The effect is that git_root() only traverses the directory tree for a given leaf directory once whenever Sublime needs to check if all of the commands are active (instead of 38 times).

The cache time is kept short to allow for realtime changes in git_root()'s results (if the user creates a repo, for example).

Implements a simple caching mechanism for git_root() to keep the edit…
…or responsive when editing files over slow network connections (over an SSH mount, for example). git_root() is called for each command and may stat several directories on each call. On a slow network connection, the editor can become completely unresponsive for long periods. These changes cache the result for a single call to git_root() for 5 seconds. The effect is that git_root() only traverses the directory tree for a given leaf directory once whenever Sublime needs to check if all of the commands are active (instead of 38 times). The cache time is kept short to allow for realtime changes in git_root()'s results (if the user creates a repo, for example).

kemayo added a commit that referenced this pull request Jul 1, 2012

Merge pull request #152 from jotson/master
Simple caching to keep editor responsive over slow network connections

@kemayo kemayo merged commit 2b7193b into kemayo:master Jul 1, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment