UI performance: view state, LDS and lazy loading
How to diagnose and fix slow Visualforce pages (view state, repeated getters, read-only mode, pagination) and slow Lightning web components (Lightning Data Service caching, fewer fields, lazy creation, listener cleanup, infinite loading and production settings).
Identify the common performance issues for user interfaces and demonstrate knowledge of techniques and tools to mitigate them.
~7 min read · 11 practice questions ·
What the exam expects
- Shrink a Visualforce view state with
transient, read-only components, narrower queries and pagination, and stop getters from re-querying. - Use
readOnly="true"andStandardSetControllerwhen a Visualforce page must show large collections. - Cut Lightning web component server trips with Lightning Data Service, and request fields instead of layouts.
- Defer rarely used components with tabs and
lwc:if, remove global listeners indisconnectedCallback(), and page large tables with infinite loading. - Recommend production settings for debug mode and secure browser caching.
Key terms: view state (the encrypted hidden field that carries component, field and controller state between Visualforce requests), transient (an instance variable kept out of the view state), Lightning Data Service (the managed client cache of records shared by components), lazy instantiation (creating a component only when the user needs it), debug mode (unminified framework JavaScript for development).
Key facts
- Detail
- 170 KB
- Detail
- 15 MB
readOnly="true" iteration limit- Detail
- 1,000 raised to 10,000 items
readOnly="true" query rows- Detail
- 50,000 raised to 1,000,000; no DML
- Detail
- 10,000 records; a larger query locator throws LimitException
- Detail
- Never transmitted in the view state
lightning-record-form- Detail
- Specify fields, not a layout, for performance
- Detail
enable-infinite-loadingplusonloadmore
Sources for this section (7)
- Optimize the View Statedeveloper.salesforce.com (opens in a new tab)
- Best Practices for Improving Visualforce Performancedeveloper.salesforce.com (opens in a new tab)
- Setting Read-Only Mode for an Entire Pagedeveloper.salesforce.com (opens in a new tab)
- StandardSetController Classdeveloper.salesforce.com (opens in a new tab)
- Using the transient Keyworddeveloper.salesforce.com (opens in a new tab)
- Data Guidelinesdeveloper.salesforce.com (opens in a new tab)
- Datatabledeveloper.salesforce.com (opens in a new tab)
- Why does `transient` fix a view state error caused by a list that a getter rebuilds every request?
- When is `readOnly="true"` the right fix for a Visualforce collection error?
- Why should a `lightning-record-form` list fields instead of `layout-type="Full"`?
- Which two production settings restore Lightning page speed after a misconfiguration?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the Platform Developer II pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 28 lessons of the Platform Developer II guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Inline practice questions and one-click topic practice (11 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Unlimited timed practice exams