perf: async cache initialization and remove deepcopy #8

Merged
barrettruth merged 3 commits from perf/async-init into main 2026-02-21 02:01:21 +00:00
barrettruth commented 2026-02-21 01:19:15 +00:00

Problem

First completion request blocked the UI with a synchronous vim.system():wait() call, and every subsequent key completion unnecessarily deep-copied the entire cache.

Closes #4

Solution

Use vim.system with an async callback to initialize the cache without blocking. Queue pending completion requests during loading and serve them once parsing finishes. Return cached keys directly instead of deep-copying.

## Problem First completion request blocked the UI with a synchronous `vim.system():wait()` call, and every subsequent key completion unnecessarily deep-copied the entire cache. Closes #4 ## Solution Use `vim.system` with an async callback to initialize the cache without blocking. Queue pending completion requests during loading and serve them once parsing finishes. Return cached keys directly instead of deep-copying.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/blink-cmp-ghostty!8
No description provided.