-
-
Notifications
You must be signed in to change notification settings - Fork 167
Open
Description
Current Situation
Currently, the app fetches all 10,000+ cask info models from the Homebrew API on launch and stores them in an in-memory array. This approach has two significant drawbacks:
- Slow Initial Load Time: Fetching, parsing, and compiling this large dataset at runtime causes a noticeable delay before the app is usable.
- Poor Search Performance: Searching the large in-memory array using the current fuzzy-search library is inefficient and provides suboptimal search relevance.
Proposed Solution
This plan is to refactor the core data layer to use a persistent, local SQLite database, managed by GRDB.swift.
- Persistent Storage: On the first launch, the app will fetch all cask data from the API once and populate a local SQLite database file.
- Fast Launches: On all subsequent launches, the app will read data near-instantly from the local database. The CaskInfo models will no longer be held in memory.
- Background Refresh: A background task will be implemented to periodically refresh the database from the Homebrew API, ensuring the data stays current without blocking the user.
- High-Performance Search: We will replace the current search implementation with SQLite's FTS5 (Full-Text Search) extension, which is fully supported by GRDB.
Expected Outcomes
- Improved load time
- Fast and relevant search results
- Reduced memory consumption
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Planned