-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Testing with my personal and corporate google accounts I have pretty decent latency on these drive requests.
I inspected the background page, and found the API request, "Copy as cURL" and am now running it with time and tweaking some parameters to see if i can get it faster.
On a simple query I am seeing minimum API call take 1.6s seconds, and maxing at 5.2s. Average/median is about 3ish seconds.
I tried a few things but they dont appear to be improving perf much
- migrating to drive API v3.
corpus = defaultin api v2- lastViewedByMeDate within the last three years
with all these applied it looks like:
function onInputChanged(text, suggest) {
var url = 'https://www.googleapis.com/drive/v3/files';
var date = new Date();
date.setFullYear(date.getFullYear() - 3);
var params = new URLSearchParams();
params.append('pageSize', 5);
var queries = [
// text matches
`fullText contains "${text}"`,
// only google docs (docs, sheets, slides)
`mimeType contains "google-apps"`,
// viewed in last 3 years
`lastViewedByMeDate > "${date.toISOString()}"`
];
// text matches, and it's a google doc
params.append('q', queries.join(' and '));
but like i said, the perf isn't significantly better.
The best solution is probably the same local caching approach that we ultimately did here: https://github.com/aksenol/drive-quick-search/pull/3/files
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels