function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Steve BaxterSteve Baxter 

Looking for information that details performance differences between sandboxes and production instances related to Test Class Execution.

 We find when running the full set of test classes in our sandboxes that they will take twice as long as complete. We are looking to set specific improvement benchmarks with our business leaders and need to understand expected differences in sandboxes and production.  Salesforce Support directed me to this forum as they could not provide any detail.  Thanks!
VinayVinay (Salesforce Developers) 
Hi Steve,

It completely depends on amount of data in production and sandbox and when you execute any SOQL query in your test class.  In some case test class may pass in sandbox and fail in production vice-versa.  This depends on data configured in both instances.

Check below reference which has more details.
https://salesforce.stackexchange.com/questions/42163/performance-difference-between-sandbox-and-production-instances

Please mark as Best Answer if above information was helpful.

Thanks,
Steve BaxterSteve Baxter
Thank you, Vinay.  Our comparison is between our full data copy sandbox and our production instance where the amount of data is near identical, with production having slightly more data the further we go from the refresh date.  We find our sandbox takes approximately 180 minutes where as our production instance only takes 90 minutes.  This happens even when all test classes pass in both instances.  I read through the recommended article and couldn't find anything that clarifies test class execution differences.  Do you have any further recommendations?  Thanks.