Vscode-ng-language-service: IntelliSense performance problems tsserver blocking

Created on 4 Jun 2019  路  7Comments  路  Source: angular/vscode-ng-language-service

Original from: https://github.com/angular/vscode-ng-language-service/issues/336#issuecomment-498597082

Description:

I recognize performance problems from jump to source or displaying library informations on hovering types and displaying inline docs with pressed CTRL and hovering. While here the debug output from the plugin looks smooth there is invisible blocking time between the Search Path step and the Config file name

My setup:

  • Big project with a lot of modules per lazy loading
  • Some libraries like DevExtreme, ng-bootstrap, lodash, moment, etc
  • Our own internal angular library
  • Angular Version 7.2.15
  • Angular Language Service Plugin 0.800.0

Reproduction:

  1. define something like this:
  public gridEditingOptions: DevExpress.ui.dxDataGridOptions['editing'] = {
    mode: 'batch',
    allowUpdating: true,
    allowAdding: true,
    allowDeleting: true,
    startEditAction: 'dblClick',
    selectTextOnEditStart: true,
    useIcons: true
  };
  1. hovering the type goes mostly fast:
    image

  2. now move away hover it again and press and hold CTRL:
    image

Some times it works fast when only hovering, but mostly especially with pressed CTRL it takes some time, but the debug console looks clean.

  1. hover, press CTRL and click to jump to source or press F12: same as 3. sometimes with long blocking time.

  2. With disabled language service it opens up instantly every time, no slow down, memory and cpu load not mentionable

Possible reasone:

After trying to find out where this comes i can only say that i can push the ram and cpu consumption up with a hovering and moveaway loop

  1. No file open and waited some time so that vscode calmed down:

image

  1. after hovering i think 20 times... with each step the loading takes a bit longer...

image

I think the problem is that the duplicate tsserver here blocks each other or the main blocks the angular one or vice versa, but here i can make only assumptions.

Most helpful comment

@gayanper Compiled and uploaded here.
Disable official extension while testing this build.

All 7 comments

I had a similar issue and I solved it with changes from this daf0cea commit:

  • Share the same DocumentRegistry instance DocumentRegistry between all language services.
  • Disabled Angular language service for InferredProjects (projects without tsconfig config file)
  • Retain the configured project even I close last opened file from the project. This prevents do not create or remove project on every time I open or close a file.

@JohnnyDevNull, can you try to compile and test extension from this branch.

@andrius-pra when i try to build your branch i get the following error

$ yarn run compile                                                                                               
yarn run v1.17.3                                                                                                 
$ node $(yarn bin)/installServerIntoExtension ../client ./package.json ./tsconfig-build.json && cp yarn.lock ../c
lient/server && tsc -p tsconfig-build.json                                                                       
internal/modules/cjs/loader.js:583                                                                               
    throw err;                                                                                                   
    ^                                                                                                            

@gayanper Compiled and uploaded here.
Disable official extension while testing this build.

@andrius-pra You improvement solved my issue. When can we expect these changes to end up in the master ?

Great! I will split my changes into smaller PR in coming days and @kyliau will decide if it worth to merge to master.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings