fix: prevent hang when displaying large resource counts#981
Closed
james00012 wants to merge 1 commit intomasterfrom
Closed
fix: prevent hang when displaying large resource counts#981james00012 wants to merge 1 commit intomasterfrom
james00012 wants to merge 1 commit intomasterfrom
Conversation
When resource count exceeds 500, display a summary table (counts by resource type and region) instead of listing each resource individually. This prevents pterm table rendering from hanging due to O(n²) complexity with very large datasets (e.g., 72,000+ SNS topics). Users can still get the complete list using --output json. Fixes #980
Contributor
Author
|
No longer relevant with the recent changes we've made. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--output jsonThe Problem
pterm table rendering has O(n²) complexity - it iterates all rows multiple times for column width calculation and rendering. With 72,000+ resources, this causes the tool to hang at the "Found AWS Resources" stage.
The Fix
MaxResourcesForDetailedTable = 500threshold--output jsonfor full detailsExample Output (when > 500 resources)
Test plan
Fixes #980