Commit 0f019fd
committed
Cache resolved VCS driver handles to avoid repeated repository detection
VcsDriverRegistry.resolve() calls detectRepository() which spawns 3 git
processes (rev-parse --is-inside-work-tree, --show-toplevel, --git-common-dir).
Since CheckpointStore calls resolve() for every git command (~6 per checkpoint
capture), this added ~18 unnecessary process spawns per operation.
Add an in-memory Map cache keyed on cwd + requestedKind so that once a
repository is successfully detected for a given path, subsequent resolve()
calls return the cached handle without re-running detection.1 parent f800fca commit 0f019fd
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
81 | 90 | | |
82 | 91 | | |
| 92 | + | |
83 | 93 | | |
84 | 94 | | |
85 | 95 | | |
86 | | - | |
87 | 96 | | |
88 | 97 | | |
89 | 98 | | |
| |||
0 commit comments