Thinking about performance
For Salesforce developers, there are two ways in which we can think about performance:
- Ensuring that we stay within the governor limits
- Improving application responsiveness and resource usage
It is important to understand the difference between these two ways of thinking when we deal with performance. In the first instance, our focus is solely on ensuring that we have tested the application to ensure that resources throttled by governor limits are not exceeded so that the application can proceed. This would be the default view for testing when developing a trigger on an object that is primarily created record by record in the user interface, for example. We want to ensure that our trigger can handle bulk instances such as when a data load occurs, but our predominant use case is for single record execution. We want to test that we are not going to exceed governor limits in that bulk case, but it is not to enhance the overall solution. This...