Courseiva
Performance →easyMultiple Choice

SF-PD2 Performance Practice Question

A developer is building a Visualforce page that displays a table of 1,000 Contact records. The page uses a standard controller with an extension that queries all Contacts in the constructor. Users report that the page loads slowly. Which change should the developer make to improve performance?

⚠ Common exam trap

The trap here is assuming that asynchronous loading or view state reduction can fix slow page loads caused by querying and rendering too many records at once, when the real solution is to limit the number of records displayed through pagination.

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

✓

Use a StandardSetController to enable pagination and reduce the number of records displayed per page.

StandardSetController is designed for paginating large data sets in Visualforce. By limiting the number of records per page, it reduces the initial query size and the amount of data rendered, leading to faster page loads. It also provides built-in navigation and sorting, making it a straightforward solution for improving performance.

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 a StandardSetController to enable pagination and reduce the number of records displayed per page.

    Why this is correct

    StandardSetController provides built-in pagination, allowing the page to display a subset of records at a time. This reduces the initial query size and the amount of data rendered, significantly improving load time. It also handles sorting and navigation efficiently, making it ideal for large data sets in Visualforce.

  • ✗

    Add a rendered attribute to the table to conditionally display it after the page loads.

    Why it's wrong here

    Using a rendered attribute does not reduce the initial query or data retrieval; the controller still queries all 1,000 Contacts in the constructor. The table may be hidden initially, but the data is still loaded and processed, so performance remains poor. This approach does not address the root cause of slow loading.

  • ✗

    Increase the view state by storing all Contacts in a transient variable.

    Why it's wrong here

    Transient variables reduce view state size but do not affect the query or rendering time. The controller still retrieves all 1,000 Contacts, and the page still renders them, so load time is not improved. Transient variables are useful for reducing view state limits, but they do not solve performance issues related to large data retrieval.

  • ✗

    Use JavaScript remoting to load the Contacts asynchronously after the page renders.

    Why it's wrong here

    JavaScript remoting can improve perceived performance by loading data after the initial page render, but it still requires querying all 1,000 Contacts and transferring them to the client. This may not reduce overall load time and adds complexity. It does not address the fundamental issue of querying and rendering a large number of records at once.

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 →

How Courseiva writes practice questions · Editorial policy

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.