-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
[Performance] List preview directory only once #34910
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
Closed
Closed
Conversation
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
Glandos
commented
Nov 1, 2022
skjnldsv
approved these changes
Nov 2, 2022
icewind1991
approved these changes
Nov 2, 2022
CarlSchwan
reviewed
Nov 2, 2022
CarlSchwan
approved these changes
Nov 2, 2022
|
Phpunit failure |
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>
|
At last. I spent 2 hours on the wrong path, thinking that I've adapted tests. |
|
I didn't really try to run acceptance tests locally, but by reading the log, it seems that this is just a timeout on a normal rendered element. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
getCachedPreview used to call
getFile, and this callsgetDirectoryListing(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.I have a slow machine, and the result of
preview:generate-allfrom Preview Generator on an image directory containing 1474 images went from 159 seconds to 33 seconds when all preview images already exist. When preview must be generated, this is barely efficient, since image operation are much more expensive.But this is really needed for running re-generation checks.