v0.6.24 — chat search over one plugin host (perf: 38 spawns → 1)#291
Merged
Conversation
chat search was O(conversations): the conversation_store Plugin client spawns + reaps the plugin host (and its PG pool) on EVERY rpc, and search did list + load_messages-per-conversation, so a search spawned the plugin N+1 times (~30s for 37 tiny conversations -> portal 502). Add search_async: spawn the host once, handshake once, run list + every load_messages over the live host, reap once. The File store keeps the cheap in-process scan. v0.6.24.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
chat searchtimed out (>30s → portal 502) on a tiny store (37 conversations, 81 messages). Root cause: the conversation_store Plugin client spawns + reaps the plugin host (and its PG pool) on every RPC, and search doeslist+load_messagesper conversation — so one search spawned the plugin N+1 = 38 times. The data is trivial; the spawns are the entire cost.Fix
Add
PluginConversationStore::search_async: spawn the host once, handshake once, runlist+ everyload_messagesover the live host, reap once.ConversationStoreClient::searchdispatches there for the Plugin store; the File store keeps the cheap in-process scan. ~30s → ~1s.Test
fmt + clippy clean; existing
search_conversationstest (File path) unchanged.