Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Improve photo layout performance #334

Merged
merged 8 commits into from
Oct 24, 2022
Merged

Conversation

nagmat84
Copy link
Collaborator

While I have been working on some other PRs I noticed that some bottle necks in the layout routine for albums:

  • When we rearrange the photos of the layout, the layout should be hidden such that each relayouted child triggers a re-drawing
  • Stop querying the DOM for CSS selectors several times
  • When the DOM has been manipulated (i.e. the photos have been added), we must provide the engine a time slice to catch up with the new DOM otherwise querying CSS attributes is slow (--> make justify asynchronous, wrap it into setTimeout).

@nagmat84 nagmat84 requested a review from a team October 19, 2022 13:29
@nagmat84 nagmat84 added the Merge Ready This PR is ready to be merged. label Oct 19, 2022
Copy link
Contributor

@kamil4 kamil4 left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me (untested) but I did have a few questions/comments.

scripts/main/sidebar.js Show resolved Hide resolved
scripts/main/view.js Outdated Show resolved Hide resolved
scripts/main/view.js Outdated Show resolved Hide resolved
scripts/main/view.js Outdated Show resolved Hide resolved
@nagmat84 nagmat84 mentioned this pull request Oct 19, 2022
@nagmat84 nagmat84 force-pushed the improve_photo_layout_performance branch from 1498a0a to fcb3cfb Compare October 20, 2022 14:08
@nagmat84
Copy link
Collaborator Author

I had to revert one change in c6bcfac. I also added a (long) comment what the problem is so that I (or someone else) remembers and understands what the root cause is.

Copy link
Contributor

@kamil4 kamil4 left a comment

Choose a reason for hiding this comment

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

I played with it around a bit and didn't spot any problems.

@nagmat84 nagmat84 merged commit 8c4d3a1 into master Oct 24, 2022
@nagmat84 nagmat84 deleted the improve_photo_layout_performance branch October 24, 2022 16:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Merge Ready This PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants