Target: TestSampleA
This analysis combines insights from the Git object database history (git-sizer) and the current working directory state to identify performance bottlenecks and bloat.
The repository exhibits severe bloat in its Git history (19.7 GiB total blob size) and critical structural issues with extremely large trees (32.6k entries in a single directory). These factors will significantly degrade Git performance, increase clone times, and impact CI/CD pipeline efficiency.
force-app/main/default/email/Apttus__ApttusTempEmailTemplates, contains an excessive number of entries. This is a major performance bottleneck for Git, as operations like checkout, status, and diff become very slow when traversing such large directories.
The current working directory scan reveals that the vast majority of disk space is consumed by XML files, specifically large Salesforce profile metadata.
.xml files: 1.17 GB (95% of total size) CRITICAL.profile-meta.xml files, each around 8.1 MB. These files are notorious for growing very large and changing frequently, leading to massive Git history bloat as identified by git-sizer.
| File | Size |
|---|---|
| /force-app/main/default/profiles/Read Only System Integration.profile-meta.xml | 8.18 MB |
| /force-app/main/default/profiles/Read Only System Integration Login User.profile-meta.xml | 8.18 MB |
| /force-app/main/default/profiles/Informatica System Integration.profile-meta.xml | 8.17 MB |
| /force-app/main/default/profiles/CRM Integration API Only with IPs %28DO NOT USE%29.profile-meta.xml | 8.17 MB |
| /force-app/main/default/profiles/Admin.profile-meta.xml | 8.17 MB |
| /force-app/main/default/profiles/Analytics Cloud Integration User.profile-meta.xml | 8.16 MB |
| /force-app/main/default/profiles/Sales Insights Integration User.profile-meta.xml | 8.15 MB |
| /force-app/main/default/profiles/CRM Team Administrator.profile-meta.xml | 8.15 MB |
| /force-app/main/default/profiles/B2BMA Integration User.profile-meta.xml | 8.15 MB |
| /force-app/main/default/profiles/SalesforceIQ Integration User.profile-meta.xml | 8.15 MB |
.asset files: 44.7 MB MEDIUMApttus__ApttusTempEmailTemplates directory CRITICALgit-sizer for having an extremely high number of entries (32.6k). This suggests a large number of small files, possibly temporary or generated, which severely impacts Git's tree traversal performance.
Addressing these issues requires a multi-pronged approach focusing on metadata decomposition, selective ignoring, and potentially historical cleanup.
The large profile XMLs are the primary cause of bloat. Decompose them into smaller, more manageable files. This is a critical step for Salesforce DevOps.
.profile-meta.xml file into individual components (e.g., object permissions, field permissions, Apex class access, Visualforce page access).
sfdx force:source:retrieve -m Profile:Admin -o <output_directory> --json
Then, use a tool or script to convert the retrieved profile into its decomposed format. Many Salesforce DevOps platforms and community tools offer this capability.
Apttus__ApttusTempEmailTemplates DirectoryThe directory force-app/main/default/email/Apttus__ApttusTempEmailTemplates with 32.6k entries is a major bottleneck.
.forceignore:
# Ignore temporary or generated Apttus email templates
force-app/main/default/email/Apttus__ApttusTempEmailTemplates/
.asset files: Review the content of .asset files. If they are large binary files (e.g., images, PDFs) that are not frequently updated or are better managed outside of Git (e.g., in a CDN or Salesforce Static Resources directly without versioning in Git), consider excluding them if appropriate for your workflow.
.forceignore Best Practices:
Ensure your .forceignore file is comprehensive. Common exclusions include:
# Ignore temporary files and directories
.sfdx/
.sf/
.vscode/
.DS_Store
*.log
*.bak
*.tmp
# Ignore specific metadata types if not managed in Git
# Example: If profiles are fully decomposed and you only manage specific permissions
# force-app/main/default/profiles/*
# Ignore specific large files or directories identified
# force-app/main/default/email/Apttus__ApttusTempEmailTemplates/
After decomposing profiles and managing the email templates, the Git history will still contain the large blobs. To reclaim space and improve historical performance, a history rewrite is necessary. This is a destructive operation and requires careful planning, communication, and coordination with all repository users.
git filter-repo (recommended over git filter-branch for performance and safety).
git filter-repo to remove specific file paths that contained the large profiles before decomposition.Apttus__ApttusTempEmailTemplates directory from history if it was determined to be ignorable.Example (conceptual, requires careful testing):
# Install git-filter-repo if not already installed
# pip install git-filter-repo
# Clone a fresh copy of the repository for filtering
git clone --mirror <your-repo-url> <repo-name>.git
cd <repo-name>.git
# Example: Remove specific large profile files from history
# This assumes you have already decomposed them and committed the decomposed versions.
# The paths here should be the *original* paths of the large files.
git filter-repo --path force-app/main/default/profiles/Read Only System Integration.profile-meta.xml --invert-paths --force
git filter-repo --path force-app/main/default/profiles/Read Only System Integration Login User.profile-meta.xml --invert-paths --force
# ... repeat for all large profile files ...
# Example: Remove the problematic email templates directory from history
git filter-repo --path force-app/main/default/email/Apttus__ApttusTempEmailTemplates/ --invert-paths --force
# After filtering, push the rewritten history (requires force push)
git remote set-url origin <your-repo-url> # Reset URL if it was changed
git push --force --all
git push --force --tags
WARNING: This is a highly impactful operation. Ensure all team members are aware, have backed up their work, and are prepared to re-clone the repository.
Improving the posture of this Git repository by reducing bloat and clearing bottlenecks will have a profound positive impact on Copado Source Format Pipeline jobs (Copado Functions):
git clone / git fetch: Significantly reduced time for Copado agents to clone or fetch changes from the repository, especially for fresh environments or new pipeline executions. A 19.7 GiB history is extremely slow to transfer.git checkout: Faster switching between branches and preparing the working directory for deployment, as Git will process fewer, smaller files and fewer entries in large directories.sfdx force:source:pull / sfdx force:source:deploy: When profiles are decomposed, changes to permissions will result in much smaller metadata payloads. This means faster retrieval and deployment times, as Salesforce CLI and the Metadata API will process fewer and smaller XML files.The cumulative effect will be a dramatic reduction in overall pipeline execution times, leading to faster feedback loops, more frequent deployments, and a more agile Salesforce development process.
| Name | Value | Level of concern |
| ---------------------------- | --------- | ------------------------------ |
| Overall repository size | | |
| * Commits | | |
| * Count | 6.02 k | |
| * Total size | 1.89 MiB | |
| * Trees | | |
| * Count | 68.1 k | |
| * Total size | 668 MiB | |
| * Total tree entries | 10.3 M | |
| * Blobs | | |
| * Count | 296 k | |
| * Total size | 19.7 GiB | ** |
| * Annotated tags | | |
| * Count | 0 | |
| * References | | |
| * Count | 2.55 k | |
| * Branches | 1 | |
| * Remote-tracking refs | 2.55 k | |
| | | |
| Biggest objects | | |
| * Commits | | |
| * Maximum size [1] | 569 B | |
| * Maximum parents [2] | 2 | |
| * Trees | | |
| * Maximum entries [3] | 32.6 k | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| * Blobs | | |
| * Maximum size [4] | 8.12 MiB | |
| | | |
| History structure | | |
| * Maximum history depth | 1.15 k | |
| * Maximum tag depth | 0 | |
| | | |
| Biggest checkouts | | |
| * Number of directories [5] | 21.4 k | ********** |
| * Maximum path depth [6] | 9 | |
| * Maximum path length [6] | 229 B | ** |
| * Number of files [7] | 522 k | ********** |
| * Total size of files [8] | 1.27 GiB | * |
| * Number of symlinks | 0 | |
| * Number of submodules | 0 | |
[1] 052ce9fcc2545ddf52edc42c7444cf0b458e2f95 (refs/remotes/origin/promotion/P53781)
[2] 0e220e4cdd89922286b1f3211b7949c6cc37e17c (refs/remotes/origin/SIT)
[3] e3a906db27f2ab94897e5433f350ce581fc495a0 (refs/remotes/origin/STAGING:force-app/main/default/email/Apttus__ApttusTempEmailTemplates)
[4] 63156b34fd1c2e25f7de952874ee0b5b0e879816 (74be18dac43b8487b975ba52613b1da7f5660a47:force-app/main/default/profiles/Read Only System Integration.profile-meta.xml)
[5] 71e316bf42678950abf16bde25816bea3d28efc6 (refs/remotes/origin/STAGING^{tree})
[6] 1636eacab735d68a0150f6ef8f340c5d15db9983 (refs/remotes/origin/SIT^{tree})
[7] 8e54ddb45eb26eab9ccd2a24e76e3d1f7a8be4bf (8bdd1e18f4edb836f0a91494dd008a6f12e983d2^{tree})
[8] 84590f0b227b3e6b6c50c824438d9f1af0e83d5f (refs/remotes/origin/promotion/P52015^{tree})
{
"totalSizeBytes": 1225876718,
"fileCount": 479529,
"extensionMap": {
"No-Extension": 5044,
".md": 1251,
".json": 2343,
".xml": 1173593770,
".auradoc": 2516,
".cmp": 204112,
".js": 1221190,
".css": 44976,
".design": 3798,
".svg": 44311,
".app": 1118,
".evt": 880,
".tokens": 8,
".callCenter": 17689,
".crt": 4683,
".channelLayout": 2901,
".cls": 4585504,
".component": 101587,
".asset": 44758660,
".datacategorygroup": 20350,
".dwl": 939,
".email": 154228,
".html": 443280,
".networkBranding": 10,
".page": 99522,
".pathAssistant": 25509,
".scf": 44787,
".site": 424864,
".trigger": 66213,
".apex": 444,
".soql": 231
},
"largestFiles": [
{
"file": "/force-app/main/default/profiles/Read Only System Integration.profile-meta.xml",
"size": 8182612
},
{
"file": "/force-app/main/default/profiles/Read Only System Integration Login User.profile-meta.xml",
"size": 8180860
},
{
"file": "/force-app/main/default/profiles/Informatica System Integration.profile-meta.xml",
"size": 8177429
},
{
"file": "/force-app/main/default/profiles/CRM Integration API Only with IPs %28DO NOT USE%29.profile-meta.xml",
"size": 8174366
},
{
"file": "/force-app/main/default/profiles/Admin.profile-meta.xml",
"size": 8173991
},
{
"file": "/force-app/main/default/profiles/Analytics Cloud Integration User.profile-meta.xml",
"size": 8168279
},
{
"file": "/force-app/main/default/profiles/Sales Insights Integration User.profile-meta.xml",
"size": 8158640
},
{
"file": "/force-app/main/default/profiles/CRM Team Administrator.profile-meta.xml",
"size": 8153892
},
{
"file": "/force-app/main/default/profiles/B2BMA Integration User.profile-meta.xml",
"size": 8153576
},
{
"file": "/force-app/main/default/profiles/SalesforceIQ Integration User.profile-meta.xml",
"size": 8152324
}
]
}