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: Lazy load Git properties for better performance #13211

Merged
merged 4 commits into from
Aug 20, 2023

Conversation

hishitetsu
Copy link
Member

Resolved / Related Issues

  • Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers.
    Closes Bug: Hidden Git columns are still being calculated #13182

Validation
How did you test these changes?

  • Did you build the app and test your changes?
  • Did you check for accessibility? You can use Accessibility Insights for this.
  • Did you remove any strings from the en-us resource file?
    • Did you search the solution to see if the string is still being used?
  • Did you implement any design changes to an existing feature?
    • Was this change approved?
  • Are there any other steps that were used to validate these changes?
    Git properties will not be loaded in the following cases.
    * The layout is other than the details layout.
    * All Git columns are hidden in the details layout.
    When the above cases are no longer met, Git properties loading will begin.

@yaira2
Copy link
Member

yaira2 commented Aug 18, 2023

I was thinking that we'd only calculate for the git columns that are visible. Ideally we'd do this for non git columns as well but this is where we're seeing the biggest impact on performance.

@hishitetsu
Copy link
Member Author

I think it is more efficient to retrieve all Git properties at the point of showing one Git property rather than retrieving a value each time, since accessing the Git repository has great impact on performance.

@yaira2
Copy link
Member

yaira2 commented Aug 18, 2023

By default we only show two of the Git columns, I guess with this change we should hide all of them for better performance.

@hishitetsu
Copy link
Member Author

I see, it may take some time, but I'll see if there is a better way.

@hishitetsu hishitetsu marked this pull request as draft August 18, 2023 17:29
@hishitetsu hishitetsu marked this pull request as ready for review August 18, 2023 18:32
@hishitetsu
Copy link
Member Author

I did a little research and found that Git properties are retrieved together as commit information except for status, so I'm afraid that not initializing properties that are not displayed will not improve performance.

image

@yaira2
Copy link
Member

yaira2 commented Aug 18, 2023

How about hiding the columns by default (except for status)?

@hishitetsu
Copy link
Member Author

hishitetsu commented Aug 19, 2023

How about hiding the columns by default (except for status)?

Performance can be improved if commit information is not retrieved. The downside is, if status and commit information are retrieved at different times, the total processing time will increase because the repository is accessed twice.
However, the only time the timing is different is when increasing the number of columns to be displayed, so I think it is worth addressing.

@hishitetsu
Copy link
Member Author

@yaira2 status and commit information can now be loaded at different times. Also, the default git column to display is now status only.

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 added the ready to merge Pull requests that are approved and ready to merge label Aug 20, 2023
@yaira2 yaira2 changed the title Feature: Lazy loading of Git properties Feature: Lazy load Git properties for better performance Aug 20, 2023
@yaira2 yaira2 merged commit c19ee12 into files-community:main Aug 20, 2023
@hishitetsu hishitetsu deleted the LazyLoadGitProperties branch August 20, 2023 14:26
@yaira2
Copy link
Member

yaira2 commented Aug 24, 2023

Unfortunately I'm still seeing a lot of performance issues in Git folders, is it possible it can be coming from the status bar as well?

@hishitetsu
Copy link
Member Author

I don't know, but if you fix the layout to something other than the details layout and there are still performance problems, there might be other causes. Git properties shouldn't be loaded other than the details layout.

@yaira2
Copy link
Member

yaira2 commented Aug 24, 2023

I'm having a tough time reproducing the issue consistently, interestingly it's mainly happening in the same folder but even that doesn't repro consistently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Hidden Git columns are still being calculated
2 participants