microsoft / codetour

VS Code extension that allows you to record and play back guided tours of codebases, directly within the editor.
https://aka.ms/codetour
MIT License
4.36k stars 113 forks source link

Fix performance issue with watching sub-tour directories #223

Closed ricmatsui closed 2 years ago

ricmatsui commented 2 years ago

Closes #207 Closes #216

The pattern for the file system watcher has a typo which is causing it to watch all files in the workspace folders instead of only the .tour files.

This PR fixes the typo by closing the group condition.

For testing, I am switching between two branches in a large git repo which changes >1000 files which are not .tour files.

Without the fix whenever I switch branches I see very high cpu usage of the Extension Host with many calls to discoverTours:

Screen Shot 2022-01-27 at 3 48 44 PM

With the fix whenever I switches branches there is no longer high CPU usage and no calls to discoverTours (since no .tour files changed):

Screen Shot 2022-01-27 at 3 49 14 PM
ricmatsui commented 2 years ago

Thanks for the quick review! 🚀

sheldonhull commented 2 years ago

Excited to renable. I'm impressed as I did a quick look and couldn't figure how any issues last I looked. Then again I'm a TS n00b. Appreciate this!