SF-PD2 Performance Practice Question
A developer is reviewing a custom Lightning Web Component that displays a list of 10,000 Contacts. The component uses a wire adapter to call an Apex method that returns all Contacts in a single response. Users report that the component loads very slowly and sometimes freezes. What is the most effective way to improve the component's performance?
⚠ Common exam trap
The trap here is thinking that caching or deferring the load can solve performance issues caused by large data volume, when the real solution is to reduce the amount of data loaded at once.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Implement pagination or infinite scrolling to load Contacts in smaller chunks.
Rendering 10,000 records at once is inefficient and can cause browser freezes. Implementing pagination or infinite scrolling loads data in smaller batches, reducing initial load time and memory consumption. This approach is recommended for large data sets in Lightning Web Components. Other options either misapply features or do not address the volume of data.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use `@wire` with `getRecord` instead of a custom Apex method to leverage Lightning Data Service caching.
Why it's wrong here
`getRecord` retrieves a single record, not a list of 10,000. It cannot be used to fetch multiple Contacts. While Lightning Data Service caching is beneficial, it does not apply to bulk data retrieval. This option is technically incorrect for the scenario.
- ✓
Implement pagination or infinite scrolling to load Contacts in smaller chunks.
Why this is correct
Loading 10,000 records at once overwhelms the browser and the network, causing slow rendering and freezes. Pagination or infinite scrolling limits the number of records loaded and displayed at a time, reducing memory usage and improving responsiveness. This is a standard performance optimization for large data sets in Lightning Web Components.
- ✗
Move the data retrieval to a `setTimeout` function to defer loading until after the component renders.
Why it's wrong here
Deferring the load does not reduce the amount of data transferred or rendered. The component would still eventually load all 10,000 records, causing the same performance issues. This option only delays the problem and does not solve it.
- ✗
Increase the Apex heap size by using `@AuraEnabled(cacheable=true)` to allow larger responses.
Why it's wrong here
The `cacheable=true` attribute enables client-side caching but does not increase heap size or improve performance for large data sets. The Apex heap size limit is fixed and cannot be increased. This option misrepresents the purpose of `cacheable` and does not address the root cause.
About these practice questions
Courseiva writes every SF-PD2 question from scratch — 226 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Salesforce exam blueprint
This SF-PD2 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SF-PD2 exam.