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
file_exists() is up to 100x slower then is_dir() or is_file() #36493
Comments
|
This was referenced Apr 23, 2020
fabpot
added a commit
that referenced
this issue
Apr 24, 2020
…icolas-grekas) This PR was merged into the 5.1-dev branch. Discussion ---------- Use is_file() instead of file_exists() where possible | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #36493 | License | MIT | Doc PR | - Thanks to caching, `is_file()` is much faster than `file_exists()`. I screened the codebase for places where it could matter, here they are. Commits ------- f38904e Use is_file() instead of file_exists() where possible
This was referenced Oct 17, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inspired by https://bugs.php.net/bug.php?id=78285
benchmark:
measured on my laptop
Did a quick search thru the codebase and found looots of file_exists() calls.
Maybe someone is interessted to investigate further
The text was updated successfully, but these errors were encountered: