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
[Validator] Unnecasarry validation metadata disk reads #39945
Comments
Hum, interesting report... This is true, the |
Just to be clear, this issue is not about taking time or slowness. It's about disk reads that are not necessary. |
Thank you for this issue. |
Nope. |
Please check #44742 |
Let me try... |
…nicolas-grekas) This PR was merged into the 6.1 branch. Discussion ---------- [Validator] check for file existence lazily in loaders | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #39945 | License | MIT | Doc PR | - Commits ------- 9135405 [Validator] check for file existence lazily in loaders
Symfony version(s) affected: >= 4.4
Description
Looks like this code causes disk reads, when rendering a form, this code is called, even when validation does not take place:
Looks like
ValidatorBuilder::getLoaders()
only creates loaders and constructors fire disk reads, even ifFileLoader::loadClassMetadata()
is not called.Possible Solution
Check
is_file()
,is_readable()
,stream_is_local()
only when validation is executed (FileLoader::oadClassMetadata()
is called).This can be further reduced with caching, so it des not check files on each HTTP request.
The text was updated successfully, but these errors were encountered: