Benchmarking Your Indexer Performance
Why Benchmark Your Indexer?
Benchmarking is a critical tool for understanding and optimizing your indexer's performance. By collecting and analyzing performance metrics, you can:
- Identify bottlenecks in your indexing pipeline
- Determine if performance issues are due to data fetching, processing, or database operations
- Measure the impact of code optimizations
- Set realistic expectations for indexing speed
- Plan infrastructure requirements for production deployments
Running Benchmarks
Capturing Benchmark Data
To collect performance metrics while your indexer is running:
pnpm envio start --bench
Note: Benchmarking adds some memory and processing overhead. It should not be enabled in production environments, as it holds benchmark data points in memory and periodically writes them to disk.
Viewing Benchmark Results
After running your indexer with benchmarking enabled, you can generate a performance summary:
pnpm envio benchmark-summary
This command processes the collected benchmark data and displays a comprehensive performance report.
Understanding Benchmark Output
The benchmark output is divided into several sections, each providing insights into different aspects of your indexer's performance: