Skip to content

Auto import suggestions heavily slows intellisense #32174

Closed as not planned
Closed as not planned

Description

@ProTip

TypeScript Version: 3.6.0-dev.20190628

Search Terms: auto import auto import performance

Code

Enter this into a blank TypeScript project in VSCode:

import {S3} from 'aws-sdk'

const a: s

Expected behavior:
Intellisense suggestions to pop up in under 500ms.

Actual behavior:
2+ seconds for the suggestions to appear.

After banging my head for a few hours trying to get to the bottom of intellisense slowness(next, insiders, old versions, etc, etc) I narrowed this down to auto import suggestions; disabling this feature removes the delay. I believe tsserver provides this service to VSCode? The aws-sdk does have a huge type surface area..

Activity

  1. asvetliakov commented on Jun 29, 2019

    @asvetliakov

    Same issue here. Using aws-sdk only in a few files but it slows down whole project

  2. RyanCavanaugh commented on Jul 10, 2019

    @RyanCavanaugh
    Member

    It's not clear what to do here - people looove auto-import, but clearly there are too many things in aws-sdk to performantly offer. It'd be a bummer if the feature just "turned off" when a complex library was around, but there's no obvious culling strategy for reducing the number of things in the list when there are too many.

  3. ProTip commented on Jul 18, 2019

    @ProTip
    Author

    I haven't had the chance to dive into this(I have never looked at the code in this project so I'm pretty much procrastinating) but I had hoped it was just an algorithm choice or caching issue.. But isn't everything? 😄

    For my part I usually care more about auto-import suggestions for my own code. Having that option may be a nice stop-gap for people who don't want to completely disable it.

    Outside of that perhaps fuzzy-ish search through all the available types could be disabled? And/or a prefix index? I'm just spit-balling here as I have no clue as to why it should be so dang slow. Really I suppose I or somebody else would need to hook up the profiler and figure out where the time is(could be VSCode).

  4. Pajn commented on Sep 23, 2019

    @Pajn

    Databases can search through millions of items in no times. A lot of exports from any library should not be a problem with the correct data structure and algorithm.

    If you want to provide suggestions while typing it sounds like the classbook example of a problem solved by a radix index/tree.

  5. OliverJAsh commented on Dec 7, 2021

    @OliverJAsh
    Contributor

    I filed a suggestion for VS Code to show some suggestions whilst waiting for auto import suggestions, so that other suggestions are not slowed down by auto import suggestions: microsoft/vscode#138449. Unfortunately the issue was closed, but if there's no way to improve performance on TypeScript's side then I think this issue should be re-opened. It would be great if other people could chime in on that issue.

    For now, I've had to disable auto import suggestions entirely because they are so slow.

  6. locked as resolved and limited conversation to collaborators on Dec 3, 2025
  7. RyanCavanaugh commented on Dec 3, 2025

    @RyanCavanaugh
    Member

    Closing language service bugs related to the 6.0 implementation. For more information, see #62827

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions