Reduce stat(2) calls by nobu · Pull Request #37265 · rails/rails · GitHub
source link: https://github.com/rails/rails/pull/37265
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Conversation
Summary
File.file?
and other predicates for permissions can use same stat(2) call result.
Hmmm... since ActionDispatch::Static is based around this:
def call(env) @file_handler.attempt(env) || @app.call(env) end
... this change causes any request that is not for a static file to raise 5-10 exceptions that are silently rescued. I think the original code is probably faster for requests handled by the app.
No reviews
No one assigned
None yet
No milestone
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK