---
schema_version: "1"
id: 3996b1e23fb384ca717266c3f49e2084fd4ea93b91d53472ad59429d87df9919
title: Visualforce Performance Case Study
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-pages-developers-guide/guides/pages/best-practices/best-practices-performance/pages-best-practices-perf-case-study.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-pages-developers-guide/guide/pages-best-practices-perf-case-study.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a3d3f9a890a05133481bef2295f01a570c3b216c3148be3233bdf08654d143b8
products:
  - Visualforce Developer Guide
  - Platform Developer Content
---

# Visualforce Performance Case Study

To understand how Visualforce performance optimizations work together, examine ways to reduce the load time of a page with a large data grid and a complex object hierarchy.

Imagine that you have a Visualforce page with a data grid to collect sales forecasts. The data model for the forecast contains a multilevel object hierarchy. The page also contains calculations to display pivoted data. For an average user, the grid contains roughly 1,500 cells, which cause the page to load slowly and to hit heap and view state limits.

To optimize page performance, you can:

-   Make the page targeted and task-focused. Using the same page for both input and aggregate reports adds unnecessary complexity.
-   Create a custom object to hold aggregate data for reporting. Removing the formulas needed to display aggregated data reduces the heap size.
-   Avoid displaying every account on a single page. Implement pagination, which improves page load speeds and reduces the size of the view state.
-   Make the data grid cells read-only. Have users select the cells to edit them, then use Ajax to save the users’ edits. These practices reduce the size of the view state.

