Commit a64e6a2
Optimize preflight-check brew calls for significant performance improvement
Refactor cask preflight checks to call 'brew list --cask' only once instead
of repeatedly in loops. This reduces brew invocations from O(N) to O(1),
providing 10-20x faster execution for typical installations.
Changes:
- Add single upfront 'brew list --cask' call to cache all installed casks
- Replace individual brew calls with grep against cached list
- Remove marker tag suffixes (:brew, :manual) - output package names directly
- Simplify parsing logic by eliminating regex_replace operations
Performance impact with 10 casks:
- Before: 20 brew invocations (2 per package)
- After: 1 brew invocation + fast grep operations
Addresses code review feedback from copilot-pull-request-reviewer.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Paolo Mainardi <paolomainardi@users.noreply.github.com>1 parent dc476ad commit a64e6a2
1 file changed
+18
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
116 | 122 | | |
117 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
118 | 127 | | |
119 | | - | |
120 | | - | |
| 128 | + | |
| 129 | + | |
121 | 130 | | |
122 | 131 | | |
123 | 132 | | |
| |||
126 | 135 | | |
127 | 136 | | |
128 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
129 | 141 | | |
130 | 142 | | |
131 | 143 | | |
132 | | - | |
133 | | - | |
| 144 | + | |
| 145 | + | |
134 | 146 | | |
135 | 147 | | |
136 | 148 | | |
| |||
141 | 153 | | |
142 | 154 | | |
143 | 155 | | |
144 | | - | |
145 | | - | |
| 156 | + | |
| 157 | + | |
146 | 158 | | |
147 | 159 | | |
148 | 160 | | |
| |||
0 commit comments