-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a simple LRU cache to common git cmds
Simple commands such as ref existence, id lookup, and distance lookup are pretty common and could be called with the same args at a higher level such that its difficult to dedupe between calls. To speed things up, add a lru_cache decorator so that later calls are looked up. We don't add this to everything since more complex functions are unlikely to be called with the same args multiple times. These calls are mostly pure functions since revup generally doesn't change the git database. There are a few exceptions to that, when it runs "reset" for certain commands. In these cases, we empty all caches just to be safe. Topic: cache Reviewers: brian-k
- Loading branch information
1 parent
ce3a07d
commit 3f03c26
Showing
4 changed files
with
30 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters