Commit 5642d6c
committed
terraform/aws: Parallelize region discovery in gen_kconfig_location
The gen_kconfig_location script was querying AWS for availability zone
information for each region (20-30 regions) sequentially. Each region
query required a separate AWS API call to describe_availability_zones,
resulting in 5-15 seconds of serial API calls.
This change parallelizes the availability zone discovery using
ThreadPoolExecutor, allowing all regions to be queried concurrently.
This reduces the total execution time from the sum of all requests to
approximately the time of the slowest single request, providing a
10-20x speedup for first-time runs.
The output order is preserved by collecting results in a dictionary and
printing them in the original region order.
Generated-by: Claude AI
Signed-off-by: Chuck Lever <[email protected]>1 parent de06bb0 commit 5642d6c
1 file changed
+30
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
136 | 137 | | |
137 | 138 | | |
138 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
139 | 166 | | |
140 | | - | |
141 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
142 | 170 | | |
143 | 171 | | |
144 | 172 | | |
| |||
0 commit comments