🧢SnapBack

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:

MetricTargetBudget
VSIX File Size≤ 2 MB2.0 MB
Bundle Size≤ 1 MB1.0 MB
Load Time≤ 500ms500ms
Activation Time≤ 300ms300ms

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:

  1. Tree Shaking - Remove unused code during build
  2. Code Splitting - Load features on demand
  3. Asset Optimization - Compress images and other media
  4. Dependency Management - Remove unused dependencies
  5. 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:

  1. On Pull Requests - Budgets verified before merging
  2. On Release Builds - Budgets enforced for production releases
  3. 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:

  1. Impact on Bundle Size - Use dynamic imports for large features
  2. Load Time Effects - Defer non-critical initialization
  3. Runtime Performance - Profile CPU and memory usage
  4. Dependency Choices - Prefer smaller, focused libraries

For CI/CD

Our pipeline includes:

  1. Size Checks - Verify VSIX and bundle sizes
  2. Performance Tests - Measure load and activation times
  3. Budget Enforcement - Fail builds that exceed budgets
  4. Trend Analysis - Detect performance regressions

Troubleshooting

VSIX Size Issues

If the VSIX exceeds the size limit:

  1. Run pnpm run package-vsix to generate a new build
  2. Check pnpm monitor-vsix-size for detailed size breakdown
  3. Remove unused dependencies or assets
  4. Use dynamic imports for large modules

Load Time Issues

If load times are too slow:

  1. Profile the extension activation in VS Code
  2. Defer non-critical initialization
  3. Optimize synchronous operations
  4. 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.

Privacy First: SnapBack works 100% offline on the Free plan. MCP is optional and requires explicit consent on paid plans. Learn more →