Repository navigation
refactor: Defer loading provider catalog at startup - #52816
devicenull wants to merge 1 commit into
Conversation
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
I measured this while looking at startup, and the win is real but a lot smaller than the 850 ms in the description — worth having the number before it is prioritised. Method: build the CLI twice, once with the real catalog and once with an empty one, and time the compiled binary. Apple M4 Pro, macOS 27.0.1, bun 1.4.2, catalog
So the whole catalog costs ~27 ms at CLI load and ~68 ms at server boot on this machine. For reference, For scale, the CLI command graph currently costs more: a build of |
|
I opened #53593 for the same thing before I found this one, sorry for the overlap. One case this misses: the model picker also uses On the size question above: the TUI fetches Happy to close mine if you add the model picker case, or the maintainers can take whichever they prefer. |
I was running this on a xen VM with limited memory - so my parse times are probably significantly longer.
If yours solves the issue, I'm happy to close this in favor of yours. I was just tired of the slow startup times I was seeing. |
|
This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2. — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
Issue for this PR
Closes #52821, #47677, #41078
Type of change
What does this PR do?
The provider list is loaded on every startup, even though it's only needed on the very first startup (or when you run /connect). This is a ~6MB json blob, and my machine takes ~850ms to load it. Given that this isn't necessary, this seems like a pretty big performance win.
How did you verify your code works?
I am actively using a version with this change - also verified that /connect still works
Screenshots / recordings
n/a
Checklist
If you do not follow this template your PR will be automatically rejected.