-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[Performance] Reuse preview directory listing #35129
Conversation
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.
Am I right that this PR "only" moves the getDirectoryListing
call from getSmallImagePreview
to generatePreviews
?
All other code changes are to:
- pass
previewFiles
to all the methods - reuse some logic to make
getSmallImagePreview
smaller withgetCachedPreview
andgenerateProviderPreview
Yes, the rationale is that calling I've noticed that |
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.
👍 nice one!
@Glandos can you rebase ? our bot cannot rebase on forks this should help bring the branch up to date and help wake up the CI jobs that got stuck |
@PVince81 commented on Jan 11, 2023, 9:01 PM GMT+1:
This is now rebased on current master. |
Failures seemed unrelated but restarted cypress to be sure ;) |
hmmm, is background rendering using the previews endpoint ?
|
getCachedPreview used to call `getFile`, and this calls `getDirectoryListing` (or underlying function that list directory) to find the file. This was done for every preview spec. Now, this is done only once at the beginning of the loop, and the array is just iterated when needed to find the correct entry. Signed-off-by: Glandos <bugs-github@antipoul.fr>
Signed-off-by: Glandos <bugs-github@antipoul.fr>
Signed-off-by: Glandos <bugs-github@antipoul.fr>
Signed-off-by: Glandos <bugs-github@antipoul.fr>
getDirectoryListing should return all files getFile is not called anymore Signed-off-by: Glandos <bugs-github@antipoul.fr>
use directory listing in both functions to gain 25% speed on run where every preview already exist. Signed-off-by: Glandos <bugs-github@antipoul.fr>
Signed-off-by: Glandos <bugs-github@antipoul.fr>
Superseed #34910
Use directory listing in both functions to gain 25% speed on run where every preview already exist.
I went from "./occ preview:generate-all" from 159 seconds down to 17 seconds on a directory full of images with already generated previews.