As far as I know, In Phoenix, after compilation all the templates files are functions with their Embedded markup content. So, instead of reading the template file every time, we call respective render function which are created at the compilation time.
So, The best part is at the time of compiling, we can read the file content and develop a function. In runtime use that function instead of reading the file every time.
After compilation, templates are functions. Since Phoenix builds templates using linked lists rather than string concatenation the way many imperative languages do, one of the traditional bottlenecks of many web frameworks goes away. Phoenix doesn’t have to make huge copies of giant strings.
– Chris McCord, Programming Phoenix 1.4