Skip to content

Automatic classification: more aggressive debounce and perf considerations #129607

@isidorn

Description

@isidorn

Testing #129436

On my machine it takes around 300ms for the language classification to compute. However some of our users have a slower machine, so here are some ideas on how to make sure to not slow down when users that are just scribbling in an untitled editor.

  • Do not classify when less than 20 characters present (unless to reset mode if file has auto detected already) - Done in microsoft/vscode-languagedetection@b024b29
  • Increase debounce from 300ms to 600ms (this will still not be a noticeable lag when the user stops typing, pastes) - Done in Improve performance of language detection #130006
  • If you have already run the classification n times and every time you are unsuccessful maybe stop trying and only on larger changes run
  • If you already auto detected a language - great! Do not be so aggressive then, only if a big change to the file content happened

Both 3 and 4 require some knowledge about what is a bigger change to a file. We can figure something out. Maybe @bpasero has ideas

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions