Performance Budgets & Monitoring
SnapBack maintains strict performance budgets to ensure a fast and responsive experience for developers.
Performance Targets
We enforce the following performance budgets:
| Metric | Target | Budget |
|---|---|---|
| VSIX File Size | ≤ 2 MB | 2.0 MB |
| Bundle Size | ≤ 1 MB | 1.0 MB |
| Load Time | ≤ 500ms | 500ms |
| Activation Time | ≤ 300ms | 300ms |
VSIX Size Monitoring
Our VSIX file size is monitored to ensure it stays under the 2MB limit. This is important for:
- Fast download and installation
- Minimal disk space usage
- Quick updates
Monitoring Script
# Check current VSIX size
pnpm monitor-vsix-size
Size Optimization Techniques
We use several techniques to keep the VSIX size small:
- Tree Shaking - Remove unused code during build
- Code Splitting - Load features on demand
- Asset Optimization - Compress images and other media
- Dependency Management - Remove unused dependencies
- Dynamic Imports - Load heavy modules only when needed
Load Time Metrics
We collect and monitor extension load time metrics to ensure responsive performance.
Collection Script
# Collect load time metrics
pnpm collect-load-metrics
What We Measure
- Total Load Time - Time from extension start to full initialization
- Activation Events - Which events trigger extension loading
- Platform Performance - Performance across different operating systems
Performance Budget Enforcement
We automatically enforce performance budgets in our CI/CD pipeline.
Enforcement Script
# Enforce all performance budgets
pnpm enforce-performance-budget
CI/CD Integration
Performance budgets are checked automatically:
- On Pull Requests - Budgets verified before merging
- On Release Builds - Budgets enforced for production releases
- Weekly Audits - Regular performance reviews
Monitoring Dashboard
Performance metrics are tracked in our internal dashboard and PostHog:
- VSIX size trends over time
- Load time distributions
- Performance regressions
- Platform-specific metrics
Optimization Guidelines
For Developers
When adding new features, consider:
- Impact on Bundle Size - Use dynamic imports for large features
- Load Time Effects - Defer non-critical initialization
- Runtime Performance - Profile CPU and memory usage
- Dependency Choices - Prefer smaller, focused libraries
For CI/CD
Our pipeline includes:
- Size Checks - Verify VSIX and bundle sizes
- Performance Tests - Measure load and activation times
- Budget Enforcement - Fail builds that exceed budgets
- Trend Analysis - Detect performance regressions
Troubleshooting
VSIX Size Issues
If the VSIX exceeds the size limit:
- Run
pnpm run package-vsixto generate a new build - Check
pnpm monitor-vsix-sizefor detailed size breakdown - Remove unused dependencies or assets
- Use dynamic imports for large modules
Load Time Issues
If load times are too slow:
- Profile the extension activation in VS Code
- Defer non-critical initialization
- Optimize synchronous operations
- Use background tasks for heavy computations
Performance Testing
We conduct regular performance testing:
- Unit Tests - Measure individual function performance
- Integration Tests - Test feature load times
- End-to-End Tests - Simulate real user workflows
- Stress Tests - Test under high load conditions
For technical implementation details, see our Performance Testing Documentation.