Skip to content

Salesforce Performance Testing: Enterprise Best Practices

Author

Introduction

Seamless connectivity is a must for today’s digital economy. Salesforce is not just a CRM; it’s the backbone of your organizational activities. As companies grow, they may need to incorporate complex API integrations, extensive data sources and sophisticated custom coding, all of which can lead to technical spanners.  

It’s often thought of as a luxury or a last check before a big release, but performance testing in Salesforce should be taken very seriously. It is in fact a key component of enterprise risk management. Millions of dollars and erosion of customer trust can be lost in a single second of latency in a customer facing portal or a timeout in a high-volume batch process.  

This Salesforce Performance Testing guide covers professional standards, enterprise best practices, and strategic planning to run successful tests in the Salesforce environment. 

Knowing what is involved in the Multi-Tenant Architecture Challenge.

The key to Salesforce performance testing is to understand the limitations of multi-tenancy. Salesforce runs on shared infrastructure, unlike on-premises software, where you can just throw more hardware at the problem. Salesforce runs on a shared, multitenant platform and Governor Limits are enforced to help keep instances stable from Apex scripts that use resources. From CPU time and memory usage to the number of SOQL queries fired in a single transaction, there are many limits. Effective Salesforce governor limits testing helps identify resource bottlenecks before they impact production users. 

The “Efficiency Over Brute Force” Paradigm 

In a typical scenario, performance testing typically involves determining how many requests a server can handle before it fails. The “server” will not break in Salesforce, rather it will be the platform’s safety governors that will kill your specific transaction. In this context performance testing is more about making sure your custom architecture (triggers, flows and integrations) work well within those limits under heavy load. 

What are the Key Performance Indicators (KPIs)?

Stakeholders need to be on the same page when it comes to the definition of “performance” in the business before any technical execution is undertaken. When performance testing, there are four main metrics that professional test takers use: 

  1. Response Time (Latency): Time elapsed from a user input (such as click ‘Save’) to the UI return to an interactive state. Ideally synchronous transactions should be kept below 2 seconds for a seamless experience.  
  2. Throughput: Transactions or records that are processed in a given amount of time (e.g., 10,000 leads processed through integration per hour).  
  3. Concurrency: The ability of a system to process multiple user or processes simultaneously running transactions without any occurrence of record-level contention or “Row Lock” exceptions. 
  4. Resource Usage: Tracking Apex CPU time and heap size. If you consistently see 80% CPU time usage, then there is no “burst capacity” for the seasonals. 

The Lifecycle of a Performance Test

Performance testing for enterprises is not a single occurrence. It should be a part of the Dedicated Development Lifecycle (SDLC). 

Phase 1: Baseline Establishment 

How can you improve if you don’t know where you are starting? Record data during regular business operations. This is the control group to compare the results of your experiments. 

Phase 2: Scenario Modelling 

Determine “Critical Business Processes” (CBPs). Don’t worry, you don’t have to test each button in Salesforce.  Focus on: 

  • High-volume data imports. 
  • Complex Quote-to-Cash workflows. 
  •  Experience Cloud sites that are accessible to the public. 
  •  Heavy ERP integrations (such as SAP or Oracle).
     

Phase 3: Test Data Preparation 

The most frequent mistake is to test in a “skinny” sandbox. If you have 10 million contacts in your production environment and only 500 contacts in your test environment, your SOQL queries will return different results. Indexes that perform well on small data sets can break or switch to a full table scan on larger data sets. Make sure your test environment is representative of production data volumes.

Best Practices for Apex and Automation

For platforms, they’re usually due to custom implementations and not a standard feature. These are some enterprise testing standards to be followed in all development and automation processes: 

Optimize SOQL and DML 

Selective Queries: Use Indexed Fields in SOQL WHERE Clause: Make sure that SOQL queries use indexed fields in the WHERE clause. For the performance testing, it is important that the test is designed to validate query selectivity, as it is a feature that doesn’t become apparent until data volumes exceed 100,000 records and with deliberate effort. 

Bulkification: Testing using a single record is not enough to ensure enterprise scalability, all Apex components need to be tested against large records sets. One common failure point is when a script is able to successfully process one record, but exceeds the governor limits for processing a normal batch of 200 records. 

This was the “One Trigger Per Object” Rule.

Many triggers attached to an object can lead to unexpected execution and duplicate processing. Without altering the code, measure “Total Execution Time” of an object during his/her performance testing. The combined latency of six flows (all triggered by the same update) and three triggers will become a problem if the update itself is simple. 

Flow vs. Apex 

Salesforce “Flow” is a very powerful low code tool, but in general, it will not be as fast as optimized Apex when processing large volumes. For instance, if a particular Flow is returning a response in 500ms on 2,000 records, it could be a sign that the logic needs to be refactored into a high-performance Apex Service Layer.

Strategic Handling of Large Data Volumes (LDV)

Enterprise customers frequently have to manage hundreds of millions of records. Salesforce scalability testing helps validate whether the platform can handle increasing data volumes, users, and transaction loads. These are all environments where specialized strategies are needed for performance testing: 

Skinny Tables: Salesforce can do skinny tables when you need to report or query on a data set that typically doesn’t require joins, and includes only the fields that are most often used for each object. 

External Objects: If the system is unable to test quickly enough, externalize the data and access it through Salesforce Connect. This helps to keep the “hot” data in Salesforce lean and quick. 

Vital to indexing strategy: Custom indexes. But excessive indexing can cause overheads, which can inadvertently affect insert and update performance. The goal of your testing is to determine the “Goldilocks zone” that is best for read speed, but not at the expense of write speed. 

The Role of Sandbox Environments

Not all sandboxes are created equal. To test performance, the surrounding is of paramount importance:  

Full Sandboxes: These are the highest level of sandboxes that have the full copy of production data. The testing of the performance is the best done here. 

Partial Copy Sandboxes: handy for testing individual modules, but be careful of “simulated” performance. 

Developer Pro Sandboxes: Usually too small for performance testing and don’t have the density of data that would be found in production. 

Pro Tip: Always run your performance tests during a sandbox “quiet window.” If other developers are running massive data loads or deploying code at the same time, it will completely skew your latency results. 

Performance Testing Tools

Salesforce offers some built-in tools but in enterprise scenarios, there is a need for more powerful tools. 

Salesforce Event Monitoring: This is the most powerful native tool. It offers in-depth logs of each user interaction, such as “Apex Total Time” and “DB Time. 

Query Plan Tool: This tool is found in the Developer Console that enables one to view the query plan that Salesforce’s query optimizer will use to perform a particular SOQL statement. 

External Load Testing (JMeter, LoadRunner): For public endpoints or Experience Cloud sites, use third-party testing tools to simulate heavy user loads under realistic conditions. 

Important: If you wish to perform a high-volume “Stress Test” you must notify Salesforce and receive approval to do so, otherwise, you will be identified as a Distributed Denial of Service (DDoS) attack. 

Identify and resolve row locks.

For an enterprise that operates in a highly concurrent environment, “Row Locking” is a silent performance killer. This happens when two processes try to modify the same record (or its parent) simultaneously. Take special care of the UNABLE_TO_LOCK_ROW error during performance tests. Common culprits include: 

Account Hierarchy: Sometimes updating child contacts will lock the parent Account, as part of Account Hierarchy. 

Lookup Rollup Summary Plugins: These are often used to make recursive background updates to parent records which can result in lots of data contention and row-locking errors when the system is heavily loaded. 

Custom Integration Middleware: Too aggressive concurrent threads in your middleware will most likely create row locks. Tune performance testing to identify the best “Thread Count” for performance and stability. 

Integration Performance Testing.

Salesforce is NOT an island. It is linked to the middleware such as MuleSoft, Boomi or Informatica. Salesforce integration performance testing should be performed end-to-end to validate APIs, middleware processes, and data flows. 

Payload Size: Timeouts can occur for large JSON/XML payloads. Test a variety of payload sizes to determine the limit. 

Asynchronous Processing: If possible use asynchronous patterns (Platform Events, @future methods, Queueable Apex) for integrations. These “background” jobs should be performance tested to ensure that they finish in a reasonable time and don’t block the queue. 

Test daily API limits: Keep track of your daily API limits while testing. What works for 10 users may take seconds to integrate with 24 users and blow out the 24-minute limit.An inefficient integration may look great at 10, but max out at 24 at minutes.

Changing the Culture to be Performance Testing Culture.

The best performing enterprise organisations see performance as a collaborative effort rather than a QA problem. 

Design Reviews 

Prior to any code being written, architects should scan the design for possible performance implications. 

Automated Regression 

Use automated performance checks. The system should alert in the CI/CD pipeline if one of the core processes (such as ‘Convert Lead’) suddenly starts taking 30% longer after deployment, before it reaches production. 

Continuous Monitoring 

Performance testing doesn’t end after deployment. Monitor actual performance using tools such as New Relic or Salesforce Event Monitoring. Users may use the system in ways the developers did not consider and real-world data can show up problems that tests did not. 

Conclusion: The ROI of Performance.

The bottom line of using resources for Salesforce performance testing is that it becomes an investment in protecting the core business activities from disruption. A 3 hour slowdown in a system can be more expensive for an enterprise than the annual salary for the engineering team which could have prevented it.  

Respecting Salesforce’s multi-tenant architecture, concentrating on high-density data volumes and thoroughly testing your own custom Apex and automation will make Salesforce an asset, not a bottleneck. Performance is not a fixed place but a journey towards efficiency. As your business evolves and needs to grow constantly, you need to do the same with your quality assurance and testing methods.  

Try to begin by creating a baseline, target your key business processes, and create a ‘fast culture’ where ‘fast’ matters as much as ‘functional’. Is Salesforce going to keep up with peak user needs? You don’t need to wait until your busiest quarter of the year to find out, so find out in your sandbox today! 

You can also connect with experts like Mirketa to discuss bottlenecks you are facing or email at info@mirketa.com your queries. 

Author

FAQ

FAQs

Salesforce Performance Testing is the process of evaluating how Salesforce applications, custom Apex code, Flows, APIs, and integrations perform under different user loads and data volumes. It helps identify bottlenecks, improve response times, and ensure the platform remains stable during peak business operations. 

Enterprise organizations rely on Salesforce for mission-critical processes. Salesforce Performance Testing helps prevent slow response times, governor limit exceptions, API failures, and integration bottlenecks. It also ensures business continuity during high-traffic events and large-scale data processing. 

You should perform Salesforce Performance Testing before major releases, after implementing custom Apex or Flows, before integrating third-party systems, during data migration projects, and whenever significant user or data growth is expected. 

Organizations commonly use Salesforce Event Monitoring, Query Plan Tool, Apache JMeter, LoadRunner, and monitoring platforms like New Relic. These tools help analyze system performance, simulate user load, and identify performance bottlenecks across Salesforce environments. 

Salesforce enforces governor limits to maintain platform stability. Performance testing identifies inefficient SOQL queries, excessive DML operations, CPU time consumption, and poorly optimized Apex code before these issues affect production users.

Yes. Salesforce Performance Testing validates API response times, middleware efficiency, payload handling, asynchronous processing, and external system integrations. It ensures reliable communication between Salesforce and platforms like ERP, SAP, MuleSoft, or Boomi under heavy workloads. 

You Have Questions,
We Have Answers

Talk to our experts today and explore how we can help you build a connected and efficient digital ecosystem.