-
-
Notifications
You must be signed in to change notification settings - Fork 455
Add Cancellation token for file system enumeration #301
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
Conversation
|
That seems what #195 is trying to do. You can take a look on the same method in that pr. |
|
Ok cool, yeah I haven't looked at the code yet, just being taking it for test drives, will do so very soon |
|
I think enumerate all file including subdirectory for about 200000 results may take about 5s and 200MB memory, which is still costly. This should still be added with an cancellation token. |
|
agree and agree, wonder if there is a better way to do this. also maybe if we want to do it in separate pr so cancellation is not blocked by this other fix |
That's already exist in #195, so no worry! |
|
I also fix some code that is used for testing in #195, which isn't a big deal. |
|
After merging the dev, the recursive search for 180000 result takes about 5s to finish, which is significantly faster than before. |
|
From testing, seems that the large amount of result won't be collected by GC even after a few other queries. By changing the List capacity, it should show a memory lower down but seems no effect.... |
|
Unintentionally add a test code in PublicAPIInstance due to #300, should remove it before merging. |
this one? |
Yes |
Plugins/Flow.Launcher.Plugin.Explorer/Search/DirectoryInfo/DirectoryInfoSearch.cs
Outdated
Show resolved
Hide resolved
I cannot reproduce the error....Could you please provide the stacktrace for that error? |
This maybe related to the null check, will check again later |
|
Separate pr please |
Sure |
|
sorted in ff5e369 |
Nice! I understand that why I am unable to reproduce, because I have a few quick access. |
|
yeah haha, i should have said remove roaming profile |
Hahaha 🤣 |
|
9914124 remove the extra checking to make the code clear. We don't need to check whether the quick folder list is empty and don't need to check the action keyword as what we have talked about in Window Walker plugin. |
|
@jjw24 Any further change required? |
| UpdateResults(newResults); | ||
| } | ||
| /// <summary> | ||
| /// To avoid deadlock, this method should not called from main thread |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@taooceros do you know if this comment is still relevant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think yes, because only results from main result set will be added via resultUpdateQueue, the one for context menu and history is still added directly.
However, I am not sure the deadlock meaning here. Maybe just avoiding potential stunt of main ui due to lock machanism.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, thank you





fix #299
Also using EnumerationOption to avoid one access denied location breaking the whole searching similar to #209 .
Outcome: