This document tracks performance metrics for react-native-sync-vault.
- Initialization time: < 50ms
- Memory overhead per queued request: < 1KB
- Enqueue time: < 5ms
- Batch sync time: < 100ms per batch of 5 requests
- Target: < 50ms
- Current: TBD (measured during first initialization)
- Notes: Includes database initialization and schema setup
- Target: < 1KB per queued request
- Current: TBD
- Notes: Includes request metadata, headers, body, and status information
- Target: < 5ms
- Current: TBD
- Notes: Time to queue a request and persist to SQLite
- Target: < 100ms per batch of 5 requests
- Current: TBD
- Notes: Time to process a batch of requests (network time excluded)
Performance metrics are tracked automatically and can be accessed via:
import { performanceTracker } from 'react-native-sync-vault';
const metrics = await performanceTracker.getMetrics();
console.log('Initialization time:', metrics.initializationTime);
console.log('Average enqueue time:', metrics.averageEnqueueTime);
console.log('Average sync time:', metrics.averageSyncTime);- Database Indexes: All frequently queried columns are indexed
- Batch Operations: Multiple database operations are batched when possible
- Efficient Serialization: JSON serialization is optimized
- Progressive Sync: Requests are processed in batches to avoid blocking
- Turbo Module migration for reduced bridge overhead
- JSI bindings for direct native access
- Connection pooling for database operations
- Request deduplication optimization
Run performance benchmarks:
npm run test:performancePerformance regression tests are run in CI to catch performance degradation.