Why Apex Page Attributes - Performance Impact ?
I Don’t know why following attributes on an apex:page tag (or any notable omissions) affect load times. applyBody Tag applyHtmlTag docType showHeader sidebar standardStylesheets In my discussions with other developers, there have been a lot of hand-wavy assumptions that: Setting applyBodyTag or applyHtmlTag to true is noticeably faster than false. Setting showHeader, sidebar, standardStylesheets to false is noticeably faster than true. Setting a docType of html-5.0 is noticeably faster than other values. I want some concrete numbers to back up (or disprove) these assumptions. Can anyone provide them? My interpretation findings: ~50ms
The Apex component allows us to use custom components with attributes that can be passed to a Visualforce page by using tag. And impact performance. Controller is a separate thing (has own processing) so, assume there is no controller in Visualforce page.
1. No attribute A page with only html tags and no attribute added take around 50ms to load. Consider 50ms the default loading time of page which has no attribute set explicitly.
2. applyBodyTag attribute applyBodyTag = false attribute significantly increases the page loading time as now its browser or the developer's work to apply body tag properly. In comparison to 50ms it takes around 35ms.
3. applyHtmlTag and showHeader attribute This faster than applyBodyTag = false as no header needs to be rendered by Visualforce engine. In comparison to last 35ms it takes 9ms to load a page.
4. applyBodyTag and applyHtmlTag and showHeader attribute It reduces visualforce engine processing a little. In comparison to 9ms it takes 7ms.
5. docType HTML-5.0 This is true HTML-5.0 is faster and in comparison to default (#6) it takes 30ms.
6. docType default It is slower than #5. Figure at "#1 No attribute" is similar to this 50ms-58ms.
7. showHeader attribute It is faster than showHeader = true.
8. sidebar attribute When showHeader is false, sidebar automatically is false. It is faster the true values set.
9 showHeader and sidebar attribute This is slower than showHeader and sidebar = false.
10. standardStylesheets attribute This attribute does not make significant difference, but value = false is faster. Time will be reduces to few ms like if page take 35ms to load wit will take 32ms when set to false.
12. showHeader and sidebar attribute but no standardStylesheets It is same as #10. Also, longer the html text longer the processing time. More apex tags more processing time. Action functions, Action support, Remoting function and re-render increases page processing time a lot.