Skip to content

Performance#29

Merged
int2001 merged 1 commit into
dockerizedfrom
performance
Oct 7, 2025
Merged

Performance#29
int2001 merged 1 commit into
dockerizedfrom
performance

Conversation

@int2001
Copy link
Copy Markdown
Owner

@int2001 int2001 commented Oct 5, 2025

  1. 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
  1. 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
  1. 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

@int2001 int2001 marked this pull request as ready for review October 7, 2025 10:22
@int2001 int2001 merged commit 1fb941a into dockerized Oct 7, 2025
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