-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
1 parent
26e53f4
commit 97ec459
Showing
2 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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