-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Significantly improve overall performance and UI responsiveness #3045
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
Merged
Merged
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b5abe39
Improve overall performance and UI responsiveness
hez2010 291a1aa
Fix incorrect caching and use gradual cache loading
hez2010 ff56467
Discard cache if refresh manually
hez2010 04d8534
Scroll history item into view
hez2010 1d90b3b
Make directory info update real-time
hez2010 b8de0c7
Fix potential cache massed-up
hez2010 8bdf9b9
Make cache loading cancellable
hez2010 37e0402
Update cache if list changed
hez2010 8a5c9a7
Remove redundant .ToArray()
hez2010 f25d138
Fix crash if semaphore failed to wait a handle for cancellation
hez2010 eb68ded
Introduce an interval sampler for list update
hez2010 f7a904b
Fix empty prompt doesn't show in empty directory
hez2010 9632c64
Save cache to memory after loading from persistent cache
hez2010 3197576
Prevent enumerating on a modified collection
hez2010 fff82b9
Semaphore waiting improvements
hez2010 34dcdaa
Optimize file monitor to prevent UI lag when lots of file changes occ…
hez2010 9cad3ac
Make LoadExtendedItemProperties as background task
hez2010 c85e486
Avoid blocking wait on an async operation
hez2010 06b47f4
Avoid large persistent cache
hez2010 77503ed
Remove redundant .ToArray()
hez2010 c63a9b7
Fix rebase issue
hez2010 83fcf12
Merge branch 'main' into pr/3045
yaira2 5acf11f
Fixed code style
yaira2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
using Windows.UI.Xaml.Media.Imaging; | ||
|
||
namespace Files.Helpers | ||
{ | ||
static class BitmapHelper | ||
{ | ||
public static async Task<BitmapImage> ToBitmapAsync(this byte[] data) | ||
{ | ||
if (data is null) return null; | ||
yaira2 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
using var ms = new MemoryStream(data); | ||
var image = new BitmapImage(); | ||
await image.SetSourceAsync(ms.AsRandomAccessStream()); | ||
return image; | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
|
||
namespace Files.Helpers | ||
{ | ||
class IntervalSampler | ||
{ | ||
private DateTime recordPoint; | ||
private TimeSpan sampleInterval; | ||
|
||
public IntervalSampler(int millisecondsInterval) | ||
{ | ||
sampleInterval = TimeSpan.FromMilliseconds(millisecondsInterval); | ||
recordPoint = DateTime.Now; | ||
} | ||
|
||
public IntervalSampler(TimeSpan interval) | ||
{ | ||
sampleInterval = interval; | ||
recordPoint = DateTime.Now; | ||
} | ||
|
||
public void Reset() | ||
{ | ||
recordPoint = DateTime.Now; | ||
} | ||
|
||
public bool CheckNow() | ||
{ | ||
var now = DateTime.Now; | ||
if (now - sampleInterval >= recordPoint) | ||
{ | ||
recordPoint = now; | ||
return true; | ||
} | ||
return false; | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2060,4 +2060,4 @@ | |
</group> | ||
</body> | ||
</file> | ||
</xliff> | ||
</xliff> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.