Skip to content
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

Feature: Improved performance when creating new files #11114

Merged
merged 6 commits into from Jan 30, 2023

Conversation

ferrariofilippo
Copy link
Contributor

Resolved / Related Issues
Items resolved / related issues by this PR.

  • None

Improvements

  • I added a service to cache and retrieve item types that are displayed in the AddItem dialog (as suggested by the TODO comment at line 38)
  • Thanks to this the AddItem dialog loads almost istantly (except the first time which takes the same as before)
  • Caching items is almost 35k times faster than retrieving them from scratch

Validation
How did you test these changes?

  • Built and ran the app
  • Tested the changes for accessibility

Tests

Before (ticks): After (ticks):
1 4_628_610 4_620_084
2 4_607_121 1_270
3 4_370_341 27
4 4_403_786 29
5 4_444_696 25
6 4_557_643 28
7 4_499_437 29
8 4_853_208 31
9 5_106_830 32
10 4_507_856 25
11 4_865_941 34
12 4_415_248 27
13 4_626_534 25
avg 4_606_711 355_512
avg (no 1) 132

@yaira2
Copy link
Member

yaira2 commented Jan 29, 2023

@ferrariofilippo just checking, we already had some basic caching, but this improves it? Can we do the same for the right click menu for folders?

@ferrariofilippo
Copy link
Contributor Author

@ferrariofilippo just checking, we already had some basic caching, but this improves it? Can we do the same for the right click menu for folders?

Here's a comparison (old on the left and improved on the right). You can see that the first time they take the same time to open, but the second time you open it there's no delay

temp.mp4

src/Files.App/App.xaml.cs Outdated Show resolved Hide resolved
@yaira2 yaira2 changed the title Code quality: Introduced a service to cache NewItem menu types Feature: Improved performance when creating new files Jan 29, 2023
Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yaira2 yaira2 merged commit 974c6b2 into files-community:main Jan 30, 2023
@ferrariofilippo ferrariofilippo deleted the Add_Item_Dialog_Service branch January 30, 2023 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants