Skip to content

perf: completion micro-optimizations#3737

Open
fbricon wants to merge 3 commits intoeclipse-jdtls:mainfrom
fbricon:completion-optimization
Open

perf: completion micro-optimizations#3737
fbricon wants to merge 3 commits intoeclipse-jdtls:mainfrom
fbricon:completion-optimization

Conversation

@fbricon
Copy link
Copy Markdown
Contributor

@fbricon fbricon commented Mar 12, 2026

  • Optimize completion performance by caching preference manager calls
  • Combine double loop in completion proposal ranking
  • Optimize completion command assignment loop

fbricon and others added 3 commits March 12, 2026 17:53
Cache getPreferencesManager().getClientPreferences() results in local
variables to avoid redundant method calls during completion requests.
This eliminates duplicate lookups in hot code paths.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Merge two separate loops that iterate through proposals into a single
loop, reducing iterations from 2N to N. Also pre-size the HashMap to
avoid resizing during population.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Improve performance of the command assignment loop by:
- Early exit when data map is null (fast path)
- Use Map.get() instead of getOrDefault() for better performance
- Reduce unnecessary string initializations
- Better null checking reduces wasted iterations

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant