Skip to content

Optimize IconSearch for better performance on large codebases#4

Merged
mgreen-simplethread merged 1 commit into
mgreen-simplethread:mainfrom
mikedamage:feature/search-performance-optimizations
Jan 15, 2026
Merged

Optimize IconSearch for better performance on large codebases#4
mgreen-simplethread merged 1 commit into
mgreen-simplethread:mainfrom
mikedamage:feature/search-performance-optimizations

Conversation

@mikedamage
Copy link
Copy Markdown
Contributor

Summary

  • Add parallel file reading in batches of 50 using Promise.all
  • Implement early exit when all indexed icons are found
  • Remove unnecessary corpus join - tokenize files separately to reduce memory
  • Optimize idsForIcon() with pre-allocated array instead of spread/map

Performance Improvements

Optimization Impact Benefit
Parallel file reading MODERATE 2-5x faster I/O on SSDs
Early exit MAJOR Skip remaining files once all icons found
No corpus join MINOR ~50% memory reduction
Optimized idsForIcon() MINOR Fewer allocations during indexing

Test plan

  • bun run typecheck passes
  • All 71 unit tests pass
  • bun run format applied

🤖 Generated with Claude Code

- Add parallel file reading in batches of 50 using Promise.all
- Implement early exit when all indexed icons are found
- Remove unnecessary corpus join - tokenize files separately to reduce memory
- Optimize idsForIcon() with pre-allocated array instead of spread/map

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Owner

@mgreen-simplethread mgreen-simplethread left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not much better performance except maybe in cases where the index size is small, but it works.

@mgreen-simplethread mgreen-simplethread merged commit ebf80e6 into mgreen-simplethread:main Jan 15, 2026
1 check passed
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.

2 participants