Closed justinmk3 closed 11 months ago
The "schema service" in particular can be a complete show-stopper if your workspace has many big projects (which... may contain... yaml files):
2023-03-27 19:46:16 [DEBUG]: schema service: handle yaml mapping: sam -> file:///projects/sam-installation/aws-sam-cli-src/tests/smoke/templates/sar/s3-uncompressor-template.yaml
2023-03-27 19:46:16 [DEBUG]: schema service: handle yaml mapping: sam -> file:///projects/sam-installation/aws-sam-cli-src/tests/smoke/templates/sar/alexa-skills-kit-color-expert-template.yaml
2023-03-27 19:46:16 [DEBUG]: schema service: handle yaml mapping: sam -> file:///projects/sam-installation/aws-sam-cli-src/tests/smoke/templates/sar/SecretsManagerRedshiftRotationSingleUser-template.yaml
2023-03-27 19:46:17 [DEBUG]: schema service: handle yaml mapping: sam -> file:///projects/sam-installation/aws-sam-cli-src/tests/smoke/templates/sar/magic-8-ball-template.yaml
2023-03-27 19:46:17 [DEBUG]: schema service: handle yaml mapping: sam -> file:///projects/sam-installation/aws-sam-cli-src/tests/smoke/templates/sar/SecretsManagerMongoDBRotationSingleUser-template.yaml
2023-03-27 19:46:17 [DEBUG]: schema service: handle yaml mapping: sam -> file:///projects/sam-installation/aws-sam-cli-src/tests/smoke/templates/sar/AmazonConnectSalesforceLambda-template.yaml
<100s more...>
Exacerbated by https://github.com/aws/aws-toolkit-vscode/issues/3259 ?
This thing even drills into node_modules
:( (Update: https://github.com/aws/aws-toolkit-vscode/pull/3440 )
2023-03-31 08:49:16 [DEBUG]: schema service: handle yaml mapping: [removed] -> file:///Volumes/workplace/aws-toolkit-vscode/node_modules/buffer/.travis.yml
2023-03-31 08:49:16 [DEBUG]: schema service: handle yaml mapping: [removed] -> file:///Volumes/workplace/aws-toolkit-vscode/node_modules/buffer/bin/zuul-es6.yml
...
Item 3 in the above list was implemented in #3931 + #3962.
File watchers are still not fully avoided though. That's tracked elsewhere, so closing this issue.
Problem
Toolkit has various file watchers for SAM template.yaml files, CDK, etc. These can negatively affect performance.
Solution
Introduce settings to limit the cost of Toolkit file watchers:search.exclude
,files.exclude
settings. https://github.com/aws/aws-toolkit-vscode/pull/3770template.yaml
detect to be on-demand instead of eager (omnipresent, filewatcher-driven)template.yaml
is needed but not found (such as "SAM run/debug", and "Sync SAM" command), mention this in the info message. (Related: #3211)