New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLite based local cache #10326
Comments
I benched the command Full output
Blackfire trace: https://blackfire.io/profiles/ba2b0131-4cc5-4d30-af89-98bc2a92490c/graph
|
@GromNaN nice! Would be a nice tweak for this specific search special case indeed, maybe fast enough to not require anything else. |
Having said that, the SQLite based approach would likely be a fraction of the time even with this fix since it would have an index prepared. |
The search stuff was definitely not built with such a high poll rate in mind, so yeah this is not surprising you're hitting some roadblocks, but I think most of it can be fixed fairly easily.
This should help a bit already. Ideally we'd also cache the full list.json file locally but I'm in a rush now so can do some other time. I think once we have that, and possibly an optimization to search by vendor first it should be fine without introducing sqlite (which sounds to me way overkill here.. it's an array of names). Once we have the vendor name btw we can also optimize |
Testing the completion feature from #10320, the one thing that stands out is completion for available packages being rather slow, at times even seeming like it's not working (a second or two pass between the interaction and the response).
This is somewhat expected since it's based on current search feature. Testing it, I'm getting typical responses of about 800msec, going up to 1500msec. This, while it works, is not great. This might improve if the search gets "vendor only" mode as discussed in #10325, but we'll still need to use the current name-only search once the vendor is established.
I'm wondering if it would be possible to have some sort of SQLite based, actionable local metadata index for simpler operations, sort of like DNF and APT do too? It would be an optional extension, only if
ext-sqlite
is found would it be enabled / used.It would work sort of like:
Alternative is of course to improve the search speed on Packagist itself, but I'd expect that part isn't exactly trivial. Interestingly, name-only search is 50% slower for me than regular search, I guess the latter one is powered by Algolia?
The text was updated successfully, but these errors were encountered: