fix(amazonq): Reduce plugin start-up latency #7673
Merged
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.
Problem
Performance analysis of the Amazon Q extension revealed significant startup latency issues, with the extension taking over 9 seconds to fully initialize. A detailed timing analysis identified several critical bottlenecks in the startup sequence, particularly around resource caching, LSP initialization, and feature configuration. These bottlenecks negatively impact user experience during IDE startup and extension activation.
Solution
activateAmazonqLspfor everyone unless that person is using AL2 and they do not have glibc patchactivateInlineCompletionsince it is for the old inline completionTesting
Performance testing was conducted to measure the impact of the optimizations on Amazon Q extension startup time. Tests were performed on both a test package workspace and an empty workspace, with multiple runs to ensure consistency.
Test Results
Production Build (Latest):
Tests Package: 8.1s, 9.7s, 8.8s, 9.7s (Average: 9.1s)
Empty Workspace: 8.9s, 10.1s, 10.0s, 8.8s (Average: 9.5s)
Optimized Build (This PR):
Tests Package: 6.7s, 7.6s, 7.5s, 8.9s (Average: 7.7s)
Empty Workspace: 6.9s, 7.6s, 6.8s, 7.6s (Average: 7.2s)
Performance Improvement
Tests Package: 15.4% faster startup (9.1s → 7.7s)
Empty Workspace: 24.2% faster startup (9.5s → 7.2s)
Overall Average: 19.8% improvement in startup time
The optimizations show consistent performance gains across different workspace types. The reduced startup time enhances user experience by making the extension more responsive during IDE initialization.
feature/xbranches will not be squash-merged at release time.