Performance#29
Merged
Merged
Conversation
Owner
int2001
commented
Oct 5, 2025
- reduce_spots() - O(n²) → O(n) (index.js:440-466)
- Replaced nested loop with Map-based approach
- Now uses single pass with hash lookups instead of repeated array searches
- Significant speedup when cache is large
- DXCC Lookup Caching (index.js:307-373)
- Added in-memory cache with 24-hour TTL
- Prevents redundant API calls for frequently spotted callsigns
- Reduces external API load and improves response time
- Indexed Spot Filtering (index.js:46-49, 309-370, 481-507)
- Added three indexes:
- bandIndex: O(1) lookups by band
- frequencyIndex: O(1) lookups by frequency
- sourceIndex: O(1) lookups by source (cluster/pota)
- Updated query functions to use indexes instead of array filtering
- Indexes maintained automatically during spot additions/removals
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.