DanTup · GitHub

As well as probably being the cause of #1721, the performance of completions with unimported symbols is generally poor.

Testing on Windows PC with the following test (inside test\flutter_only\providers\completion_item_provider.test.ts):

	describe("with SuggestionSet support", () => {
		beforeEach("ensure SuggestionSets are supported", function () {
			if (!extApi.analyzerCapabilities.supportsAvailableSuggestions)
				this.skip();
		});
		it.only("includes unimported symbols", async () => {
			await setTestContent(`
main() {
  ProcessInf
}
		`);
			const count = 50;
			const start = Date.now();
			for (let i = 0; i < 50; i++) {
				const completions = await getCompletionsAt("ProcessInf^");
				ensureCompletion(completions, vs.CompletionItemKind.Class, "ProcessInfo", "ProcessInfo");
			}
			const end = Date.now();
			console.log(`Took ${end - start}ms to do ${count} completion requests`);
		});
	});

Output from a few runs:

Took 56426ms to do 50 completion requests
Took 57034ms to do 50 completion requests
Took 57607ms to do 50 completion requests

Read the original on github.com ↗