Join Sara Morgan for an in-depth discussion in this video Overview of top five tips for improving performance, part of Visualforce: Improving Performance.
- For the past two years, I have blogged all about development on the Salesforce Platform, and the most popular post continues to be the one I wrote about the top five tips for improving Visualforce performance. In that post, I briefly go over things you need to know to improve the performance of your pages. Now, this is a really important topic, because these days no one has any patience for slow rendering webpages, which is what a Visualforce page really is. And if people are not willing to use a page because it is too slow, it does not matter what that page does, or how many bells and whistles it has.
What good is it to have a great page if no one wants to use it? So, knowing how to optimize your Visualforce pages really is key to being considered an expert developer. Now, while there are plenty of documents out there on the web about this subject, such as this one you see here on the Salesforce developer website, about the best practices for improving Visualforce performance, these docs are pretty basic, and they do not go into much detail about the specific things, and they certainly do not demonstrate any of the techniques you are about to learn.
In this course, each chapter will focus on one of the five tips. And I will go into great detail about each one. The first one is to reduce or eliminate view state. And I will start by going over what view state is and why it is not really your friend. And should be avoided whenever possible. I will also show you how to monitor it and then specific ways you can avoid having it slow down the rendering of your pages. Number two is to evaluate SOQL statements for efficiency. There is actually a whole bunch of things you can do for this, and we'll go over just some of the most important pitfalls that developers tend to fall into when writing their SOQL.
The next one actually goes along with number one, since it involves reducing view state, but since it is such an important point, I wanted to focus on it specifically, as its own tip. And I will go over alternatives for using the built in action tags that you may want to consider. The fourth tip involves taking advantage of the StandardSetControllers when dealing with lists of data. The StandardSetController class is already optimized to work with large sets of data. And this is what tends to slow down pages the most, which is why this tip is so important.
- Reducing and eliminating view states
- Evaluating SOQL for efficiency
- Using Workbench and the Query Plan tool to evaluate queries
- Reducing use of action tags through Visualforce remoting
- Working with the StandardSetController class
- Using static resources