Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently, when rendering an ActionView::Template, the template source is loaded from the disk twice. During one rendering process, Template#source is called at least twice (once in encode! and once in strict_locals!), each of these calls runs @source.to_s. As @source is usually a Template::Sources::File, #to_s hits the disk to load the template. It is unnecessary to load the file from disk more than once just to check whether the "# locals:" comment is present.
- Loading branch information