Newer Version Available
Deploying Apex
- Change Sets
- Salesforce extensions for Visual Studio Code
- The Ant Migration Tool
- SOAP API
- Third-party tools that use Metadata API or Tooling API
- VS Code with Salesforce DX plug-ins
Compile On Deploy
Starting in Summer ‘18, each org’s Apex code is now automatically recompiled before completing a metadata deploy, package install, or package upgrade. Compile on deploy is in enabled automatically for production orgs to ensure that users don’t experience reduced performance immediately following a deployment, and you can’t disable it. For sandbox, developer, trial, and scratch orgs, this feature is disabled by default, but you can enable in Setup, under Apex Settings.
This feature causes deployments to the org to invoke the Apex compiler and save the resulting bytecode as part of the deployment. A minimal increase in deployment times can occur, but Apex doesn’t need to be recompiled on first run. So the slight increase in deployment time can prevent performance issues on first run. Consider enabling this feature in sandboxes or scratch orgs shared by multiple users for functional testing or used by continuous integration processes.
For information on setting this org preference using Metadata API, see OrgPreferenceSettings in Metadata API Developer Guide.