Skip to content

API for name completion data. #4304

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

Merged
merged 3 commits into from
Dec 7, 2020
Merged

Conversation

isoos
Copy link
Collaborator

@isoos isoos commented Nov 30, 2020

  • /api/dart2-package-name-completion-data #4302
  • Tested search responses on staging: 400-600 ms on the search instance to serve the content, a 200-500 ms more on the frontend instance to parse, transform and cache it. If we were to use a binary protocol for search, this could be reduced by about 50-150 ms.
  • The uncompressed size is about 280k, the compressed is about 80k with the default gzip settings.
  • Caching the gzipped content for 8 hours seems to be a good balance.
  • Clients that do not accept gzip encoding are rejected with HTTP 406.
  • Added to integration test (also checks on post-deployment) - as long as retry is a popular package, it won't fail :).

@isoos isoos requested a review from jonasfj November 30, 2020 15:45
@google-cla google-cla bot added the cla: yes label Nov 30, 2020
@jonasfj
Copy link
Member

jonasfj commented Dec 2, 2020

200-500 ms more on the frontend instance to parse

Is that CPU time on the main thread of the frontend instance?

That'll make a lot of other requests much slower.. Should we consider making a ?compact=1 mode for search backend, where it only returns package names?

Maybe we should forbid limit > 100 unless compact=1 on the search backend?

@isoos
Copy link
Collaborator Author

isoos commented Dec 2, 2020

Is that CPU time on the main thread of the frontend instance?

It was local benchmark.

Should we consider making a ?compact=1 mode for search backend, where it only returns package names?

Good point, however, the result format would be somewhat different: instead of "packages": [{"package": "<pkg>"}, {...}, ...] we would have `"packageNames": ["", "", ]). I'd add that in a separate PR.

Maybe we should forbid limit > 100 unless compact=1 on the search backend?

Not sure if this is necessary...

@isoos isoos merged commit 20d82c8 into dart-lang:master Dec 7, 2020
@isoos isoos deleted the name-completion branch December 7, 2020 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants