Commit 6386b3d
committed
terraform/aws: Parallelize AMI discovery in gen_kconfig_ami
The gen_kconfig_ami script was querying AWS for AMI information for each
Linux distribution (Amazon, Ubuntu, RedHat, Debian, etc.) sequentially.
With 10 different distributions, this resulted in 20-30 seconds of serial
API calls.
This change parallelizes the AMI discovery using ThreadPoolExecutor,
allowing all 10 distributions 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 an 8-10x speedup for
first-time runs.
The output order is preserved by collecting results in a dictionary and
printing them in the original owner key order.
Generated-by: Claude AI
Signed-off-by: Chuck Lever <[email protected]>1 parent 5642d6c commit 6386b3d
1 file changed
+32
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
633 | 634 | | |
634 | 635 | | |
635 | 636 | | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
636 | 658 | | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
645 | 669 | | |
646 | | - | |
647 | 670 | | |
648 | 671 | | |
649 | 672 | | |
| |||
0 commit comments