-
Notifications
You must be signed in to change notification settings - Fork 29.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User data provider should not iterate over raw changes #126660
Comments
@bpasero I can definitely debounce the listener. But I am not sure if I can avoid iterating because, currently I am filtering for user data resources and map them to user data scheme. I can skip the filter and just do mapping. |
@sandy081 remind me again why the |
I use |
Could you listen to the changes via |
I think I can actually remove this |
👏 |
I am using
Not sure how this is different from what I am doing now ? |
The file service has logic to debounce when spam occurs, so we do not fall into the trap of reacting to thousands of events: vscode/src/vs/platform/files/common/fileService.ts Lines 977 to 982 in 3252199
|
It seems |
There is: vscode/src/vs/platform/files/common/files.ts Lines 772 to 786 in 33c149f
We can add |
See #139793 |
Looking at perf traces from #124723 I noticed how quite a bit of time can be spend here:
vscode/src/vs/workbench/services/userData/common/fileUserDataProvider.ts
Line 123 in 363534d
And I was wondering how it is possible that you can access the raw file changes until I noticed how you actually listen to the raw events here:
vscode/src/vs/workbench/services/userData/common/fileUserDataProvider.ts
Line 42 in 363534d
But doing so bypasses all our logic in the file service, e.g. to produce a ternary search tree for paths from the
FileChangesEvent
. I am also considering to add some debouncing logic for the processing of these raw events in case thousands of events are fired in short period of time. I cannot do this on the level of the provider though because that is API.Can we please revisit that and see if the code would benefit from operating directly on
FileChangesEvent
? It provides powerful methods likecontains
andaffects
that can be used to lookup with a resource.The text was updated successfully, but these errors were encountered: