Skip to content

Reduce indexing memory and interactive search stalls - #145

Open
siraben wants to merge 7 commits into
ARahim3:mainfrom
siraben:performance
Open

siraben wants to merge 7 commits into
ARahim3:mainfrom
siraben:performance

Conversation

@siraben

@siraben siraben commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Large documents, portable images, repeated vector reloads, and periodic folder status refreshes could create avoidable memory spikes or repeated work. Interactive helper requests could also block behind preview rendering or obsolete query embeddings.

This draft addresses the highest-impact findings in small, reviewable commits:

  • reuse extracted and chunked document text during long-file backfill
  • cap document inputs at 64 MiB and recheck size immediately before extraction
  • keep preview rendering on a bounded two-worker queue
  • coalesce queued query embeddings that have already become obsolete
  • validate portable image geometry and route large decodes through bounded ffmpeg scaling
  • reload search vectors in place to avoid overlapping old and new matrices
  • aggregate periodic folder summaries in SQLite instead of loading every matching file record

No tests, package metadata, release configuration, or workflow YAML were changed.

Validation:

  • swift build --target DigUpKit
  • swift build --target DigUpKitTests
  • parsed every changed Swift source with swiftc -frontend -parse
  • git diff --check origin/main...HEAD
  • exercised the portable ffmpeg scaling command with the existing orientation fixture

The complete swift test run remains unavailable in this checkout because Vendor/llama/include/llama.h is absent. The existing DigUpKitTests target compiles successfully with the matching Xcode toolchain.

@siraben
siraben marked this pull request as ready for review October 23, 2026 05:25
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